[clang] [Clang] allow GNU attrs before bit-field width in member declarators (PR #185322)

Oleksandr Tarasiuk via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 3 06:51:32 PDT 2026


================
@@ -2512,11 +2512,15 @@ bool Parser::ParseCXXMemberDeclaratorBeforeInitializer(
   else
     DeclaratorInfo.SetIdentifier(nullptr, Tok.getLocation());
 
+  const bool IsFunctionDeclarator = DeclaratorInfo.isFunctionDeclarator();
+  if (!IsFunctionDeclarator)
+    MaybeParseGNUAttributes(DeclaratorInfo, &LateParsedAttrs);
----------------
a-tarasyuk wrote:

@erichkeane Thanks for the feedback. I checked it, and this change also allows Clang to accept the MSVC-style `-triple x86_64-pc-windows-msvc`... I am not yet sure whether moving this into `ParseDeclarator` will retain the msvc rejection.

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


More information about the cfe-commits mailing list