[clang] [BoundsSafety] WIP: Make 'counted_by' work for pointer fields; late parsing for 'counted_by' on decl attr position (PR #87596)

Yeoul Na via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 5 15:45:29 PDT 2024


================
@@ -4997,7 +5087,11 @@ void Parser::ParseStructUnionBody(SourceLocation RecordLoc,
 
   ParsedAttributes attrs(AttrFactory);
   // If attributes exist after struct contents, parse them.
-  MaybeParseGNUAttributes(attrs);
+  MaybeParseGNUAttributes(attrs, &LateFieldAttrs);
+
+  assert(!getLangOpts().CPlusPlus);
----------------
rapidsna wrote:

@delcypher C++ already has late parsing support for C++ classes and structs and I believe it's handled separately in `ParseDeclCXX.cpp`. I added the assertion to ensure that the code path isn't taken in C++. We should run clang tests if that breaks anything.

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


More information about the cfe-commits mailing list