-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICE with requires-clause in template lambda in requires-clause #94811
Comments
@llvm/issue-subscribers-c-20 Author: None (Alcaro)
```c++
template<typename>
concept aaa = true;
template<int> void ccc()
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
|
@llvm/issue-subscribers-clang-frontend Author: None (Alcaro)
```c++
template<typename>
concept aaa = true;
template<int> void ccc()
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
|
Crashes in |
I was expecting the constraint not to be evaluated because there's a dependent lambda which won't be instantiated at all. |
It's instantiated in the original unreduced version. I didn't think too much about what this thing does or how it parses, I just reduced the testcase. I can't tell apart what exactly these four requires keywords are doing. (I'm unsure how the original parses too, a friend wrote it.) |
w/ assertions trunk (usually assertions build is more helpful): https://godbolt.org/z/63n57T53s Assertion: clang++: /root/llvm-project/clang/lib/AST/ExprConstant.cpp:15967:
bool clang::Expr::EvaluateAsConstantExpr(clang::Expr::EvalResult&, const clang::ASTContext&, clang::Expr::ConstantExprKind) const:
Assertion `!isValueDependent() && "Expression evaluator can't be called on a dependent expression."' failed. |
Maybe related: #92596 |
70 line stack trace
https://godbolt.org/z/cojMcjhM5
A related issue is that if you swap aaa for sizeof(T)>=0, it complains about it being non-constant. How can sizeof be non-constant? https://godbolt.org/z/jEe31ch1z
The text was updated successfully, but these errors were encountered: