Closed anders-wind closed 1 year ago
With assertions enabled, I run into:
clang-16: /home/tbaeder/code/llvm-project/clang/lib/AST/ExprConstant.cpp:15331:
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.
which is the assertion we've seen several times in bug reports.
And the expression is:
ConceptSpecializationExpr 0x7fff6b4076a8 '_Bool' Concept 0x7fff6b998e68 'should_be_copy_constructed'
|-ImplicitConceptSpecializationDecl 0x7fff6b407628
| `-TemplateArgument type 'type-parameter-0-1'
| `-TemplateTypeParmType 0x62100009da10 'type-parameter-0-1' dependent depth 0 index 1
`-TemplateArgument type 'T'
`-TemplateTypeParmType 0x7fff6b9993e0 'T' dependent depth 0 index 1
`-TemplateTypeParm 0x7fff6b999388 'T'
@llvm/issue-subscribers-clang-frontend
@llvm/issue-subscribers-c-20
Looks related to: https://github.com/llvm/llvm-project/issues/62362 which has a small reproducer
These might be related? But the symptom is basically just an entire class of bugs, not necessarily the same thing. This happens any time we evaluate a constraint but don't get the template arguments setup correctly.
Also, I'm currently working on a reduction (well, CReduce now is!), but it is taking a while.
CReduce came up with something that looks like:
template <typename ah> concept ai = sizeof(ah) <= sizeof(ah);
template <typename ah> struct aj
{ aj() requires ai<ah>;
};
struct at : aj<double> {
using aj::aj;
};
void foo() {
at{};
}
So Shafik is correct, this is a duplicate of #62362 . Closing this bug as a duplicate.
Hi! I'm experiencing a crash when I'm compiling our stronk project with Clang 16. The code compiles just fine with Clang 15. I don't know whats causing the issue, but please let me know if I can supply any additional resources.
The compiler output:
See https://github.com/twig-energy/stronk/pull/36/files for the
/tmp/unit_tests-62814d.cpp
and/tmp/unit_tests-62814d.sh
files.