[clang] [clang][ThreadSafety] Enable late parse for all capabilities, under the experimental flag (PR #212615)
Jameson Nash via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 25 11:04:26 PDT 2026
================
@@ -195,6 +195,25 @@ bool Parser::ParseSingleGNUAttribute(ParsedAttributes &Attrs,
// Handle attributes with arguments that require late parsing.
LateParsedAttribute *LA =
new LateParsedAttribute(this, *AttrName, AttrNameLoc);
+
+ // Keep the innermost prototype's parameters available in case they are needed
+ // by late-parsing attributes. A function keeps its own parameters in scope,
+ // so skip it; a parameter of function type is adjusted to a pointer, so keep
+ // it.
+ if (D && (!D->isFunctionDeclarator() || D->isPrototypeContext())) {
----------------
vtjnash wrote:
You've got a good eye for asking the right questions here. Yes, that was indeed necessary too.
https://github.com/llvm/llvm-project/pull/212615
More information about the cfe-commits
mailing list