[clang] [Clang][Parser] Don't always destroy template annotations at the end of a declaration (PR #89494)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 22 09:47:01 PDT 2024


zyn0217 wrote:

> One question I have is whether it would make sense to modify DestroyTemplateIdAnnotationsRAIIObj to not call MaybeDestroyTemplateIds() in the first place

I’d love to try if it were feasible, but please note that the annotation was deleted by a direct call to MaybeDestroyTemplateIds, not using the RAII object. I tried to teach DestroyTemplateIdAnnotationsRAIIObj to have opt-in destruction, but I soon realized that would introduce more complexity/changes to callers of ParseStatementOrDeclaration, because that function isn’t aware of the context if it should clean up annotations immediately.

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


More information about the cfe-commits mailing list