[clang] [Clang] Fixed a crash when instantiating an invalid out-of-line static data member definition in a local class (PR #196772)

via cfe-commits cfe-commits at lists.llvm.org
Sun May 10 03:01:55 PDT 2026


TPPPP72 wrote:

> I think this is a timing issue: when parsing function `f`, `A` only reports an error but doesn't mark it as invalid. So, in this edge case, the erroneous `Decl` flows into `SubstQualifier` in a valid state, triggering an assertion. `A` is only marked as invalid after the entire function parsing is complete.

Therefore, I believe that in this situation, when parsing `B`, `A` is valid. However, `B` directly triggers the assertion, without giving `A` a chance to be re-marked as invalid.

https://github.com/llvm/llvm-project/pull/196772


More information about the cfe-commits mailing list