[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 02:55:09 PDT 2026


TPPPP72 wrote:

> @TPPPP72 the regression was a failure yes, but did you make sure it wasn't your original change exposing a different underlying problem? e.g. a path that isn't mishandling an invalid decl. I know there are many ways in which we end up with invalid declarations not being marked as invalid, while maintaining correct behavior because even if we don't mark the relevant decls as invalid we've generated an error, which kills the build.

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.


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


More information about the cfe-commits mailing list