-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Assertion `Ancestor->getEntity() == CurContext && "ancestor context mismatch"' failed. #30908
Comments
as of r305089 assertion fails |
as of 10d78a0 still asserts |
@llvm/issue-subscribers-clang-frontend |
I can't reproduce it with Clang 4 with assertions, but comment above claims to reproduce this 2 years ago. I wonder what I'm missing: https://godbolt.org/z/6GcbK7zzz |
It requires |
Still crashing as of post-16 trunk: https://godbolt.org/z/v4ojjvfs1
|
We got this crash on the latest trunk lately and proposed a fix (#77434). Another testcase https://godbolt.org/z/e9MYx5fqs |
…t Init Invalid (direct) initializer would invalid VarDecl so InitializerScopeRAII cannot restore scope stack balance. As with other kind of initializers, InitializerScopeRAII::pop() is moved up before Sema::ActOnInitializerError() which invalidates the VarDecl, so scope can be balanced and current DeclContext can be restored. Fixes llvm#30908
…77434) Invalid (direct) initializer would invalid `VarDecl` so `InitializerScopeRAII` cannot restore scope stack balance. As with other kind of initializer, `InitializerScopeRAII::pop()` is moved up before `Sema::ActOnInitializerError()` which invalidates the `VarDecl`, so scope can be balanced and current `DeclContext` can be restored. Fixes #30908
…lvm#77434) Invalid (direct) initializer would invalid `VarDecl` so `InitializerScopeRAII` cannot restore scope stack balance. As with other kind of initializer, `InitializerScopeRAII::pop()` is moved up before `Sema::ActOnInitializerError()` which invalidates the `VarDecl`, so scope can be balanced and current `DeclContext` can be restored. Fixes llvm#30908
Extended Description
The text was updated successfully, but these errors were encountered: