[clang] [clang] Improve `_Alignas` on a `struct` declaration diagnostic (PR #65638)

Jerin Philip via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 20 11:01:46 PDT 2023


================
@@ -94,7 +94,7 @@ class AttributeCommonInfo {
           IsRegularKeywordAttribute(IsRegularKeywordAttribute) {}
     constexpr Form(tok::TokenKind Tok)
         : SyntaxUsed(AS_Keyword), SpellingIndex(SpellingNotCalculated),
-          IsAlignas(Tok == tok::kw_alignas),
+          IsAlignas(Tok == tok::kw_alignas || Tok == tok::kw__Alignas),
----------------
jerinphilip wrote:

Looking at the activated codepaths, `_Alignas` goes through this (attribute) infrastructure for C parsing as well, but fails to disambiguate the `_Alignas` vs `alignas` information at `isAlignAs` with this change. Ideas in https://github.com/llvm/llvm-project/pull/65638#discussion_r1367333111 requires retaining the distinction rather than mixing with an `||`. 

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


More information about the cfe-commits mailing list