Open Alcaro opened 1 month ago
@llvm/issue-subscribers-c-20
Author: None (Alcaro)
@llvm/issue-subscribers-clang-frontend
Author: None (Alcaro)
Crashes in main
: https://godbolt.org/z/z93v6fx1K
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: https://github.com/llvm/llvm-project/issues/92596
70 line stack trace
```console PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script. Stack dump: 0. Program arguments: /opt/compiler-explorer/clang-18.1.0/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -S --gcc-toolchain=/opt/compiler-explorer/gcc-13.2.0 -fcolor-diagnostics -fno-crash-diagnostics -std=c++20https://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