-
Notifications
You must be signed in to change notification settings - Fork 13.5k
clang: /root/llvm-project/clang/lib/AST/Expr.cpp:3289: bool clang::Expr::isConstantInitializer(clang::ASTContext&, bool, const clang::Expr**) const: Assertion `!isValueDependent() && "Expression evaluator can't be called on a dependent expression."' failed. #88008
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
Comments
@llvm/issue-subscribers-clang-frontend Author: Ding Fei (danix800)
Clang trunk assertion failed on the following invalid initializer:
struct S {
int v;
};
struct T;
void test(struct T *t)
{
struct S s = { .v = t->y }; // t->y is invalid
} https://godbolt.org/z/GnT41GbT5 Possibly similar to https://reviews.llvm.org/D84145. |
…#88008) Use refactored CheckForConstantInitializer() to skip checking expr with error.
Looks like we had this since clang-12: https://godbolt.org/z/ohd4bMTEh Perhaps here: llvm-project/clang/lib/Parse/ParseInit.cpp Lines 509 to 513 in 896b5e5
we need or maybe here: llvm-project/clang/lib/Parse/ParseDecl.cpp Line 2713 in 896b5e5
We need These are just some ideas from debugging the crash. |
Thanks for pointing this out. Could you please also take a look at PR #88014 . It might be more consistent as a fix. |
…#88008) Use refactored CheckForConstantInitializer() to skip checking expr with error.
…) (#88014) Use refactored `CheckForConstantInitializer()` to skip checking expr with error. --------- Co-authored-by: Aaron Ballman <[email protected]>
Apologies, for the late reply. That looks like the right fix. |
Clang trunk assertion failed on the following invalid initializer:
https://godbolt.org/z/GnT41GbT5
Possibly similar to https://reviews.llvm.org/D84145.
The text was updated successfully, but these errors were encountered: