[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-04-05 Thread via cfe-commits
@@ -3035,11 +3035,14 @@ Parser::DeclGroupPtrTy Parser::ParseCXXClassMemberDeclaration( } ParsedAttributes DeclSpecAttrs(AttrFactory); - MaybeParseMicrosoftAttributes(DeclSpecAttrs); - // Hold late-parsed attributes so we can attach a Decl to them later. LateParsedA

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-04-05 Thread via cfe-commits
https://github.com/DenisGZM edited https://github.com/llvm/llvm-project/pull/133107 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-04-05 Thread via cfe-commits
@@ -296,6 +296,11 @@ StmtResult Parser::ParseStatementOrDeclarationAfterAttributes( goto Retry; } + case tok::kw_alignas: { +ParseAlignmentSpecifier(CXX11Attrs); DenisGZM wrote: No, we don't. Аor statements alignas is still illegal: ``` error: 'al

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-04-04 Thread Aaron Ballman via cfe-commits
@@ -3035,11 +3035,14 @@ Parser::DeclGroupPtrTy Parser::ParseCXXClassMemberDeclaration( } ParsedAttributes DeclSpecAttrs(AttrFactory); - MaybeParseMicrosoftAttributes(DeclSpecAttrs); - // Hold late-parsed attributes so we can attach a Decl to them later. LateParsedA

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-04-04 Thread Aaron Ballman via cfe-commits
@@ -3035,11 +3035,14 @@ Parser::DeclGroupPtrTy Parser::ParseCXXClassMemberDeclaration( } ParsedAttributes DeclSpecAttrs(AttrFactory); - MaybeParseMicrosoftAttributes(DeclSpecAttrs); - // Hold late-parsed attributes so we can attach a Decl to them later. LateParsedA

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-04-04 Thread Aaron Ballman via cfe-commits
@@ -71,6 +71,12 @@ namespace test_misplacement { [[]] union union_attr2; //expected-error{{misplaced attributes}} [[]] enum E2 { }; //expected-error{{misplaced attributes}} } +struct S1 { __attribute__((deprecated)) alignas(16) int x; }; // expected-none +class C1 { __attribut

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-04-04 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thanks for the fix! The changes should come with a release note in `clang/docs/ReleaseNotes.rst` so users know about the fix. https://github.com/llvm/llvm-project/pull/133107 ___ cfe-commits mailing list cfe-

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-04-04 Thread Aaron Ballman via cfe-commits
@@ -3035,11 +3035,14 @@ Parser::DeclGroupPtrTy Parser::ParseCXXClassMemberDeclaration( } ParsedAttributes DeclSpecAttrs(AttrFactory); - MaybeParseMicrosoftAttributes(DeclSpecAttrs); - // Hold late-parsed attributes so we can attach a Decl to them later. LateParsedA

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-04-04 Thread Aaron Ballman via cfe-commits
@@ -296,6 +296,11 @@ StmtResult Parser::ParseStatementOrDeclarationAfterAttributes( goto Retry; } + case tok::kw_alignas: { +ParseAlignmentSpecifier(CXX11Attrs); AaronBallman wrote: I think this means we now quietly accept this code: https://godb

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-04-04 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/133107 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-04-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I think this looks reasonable? I would like @aaronballman to stop by though, he might think of some reason why this isn't right per-grammar. https://github.com/llvm/llvm-project/pull/133107 __

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-04-04 Thread via cfe-commits
https://github.com/DenisGZM updated https://github.com/llvm/llvm-project/pull/133107 >From c46eda67cd7434dcce5c1f29125a940dc4ff64ba Mon Sep 17 00:00:00 2001 From: Denis Gerasimov Date: Wed, 26 Mar 2025 18:29:38 +0300 Subject: [PATCH 1/3] [CLANG] Enable alignas after GNU attributes --- clang/l

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-04-03 Thread via cfe-commits
@@ -3035,10 +3035,13 @@ Parser::DeclGroupPtrTy Parser::ParseCXXClassMemberDeclaration( } ParsedAttributes DeclSpecAttrs(AttrFactory); - MaybeParseMicrosoftAttributes(DeclSpecAttrs); - // Hold late-parsed attributes so we can attach a Decl to them later. LateParsedA

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-03-31 Thread via cfe-commits
https://github.com/Sirraide commented: Seems reasonable to me, but I’d still like @erichkeane to take a look at this as the attributes code owner https://github.com/llvm/llvm-project/pull/133107 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-03-28 Thread via cfe-commits
DenisGZM wrote: I added parsing all attributes in ParseCXXClassMemberDeclaration before calling ParseDeclarationSpecifiers and it seems to solve problem, but it also changes annotation ranges for struct and class members https://github.com/llvm/llvm-project/pull/133107

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-03-28 Thread via cfe-commits
https://github.com/DenisGZM updated https://github.com/llvm/llvm-project/pull/133107 >From c46eda67cd7434dcce5c1f29125a940dc4ff64ba Mon Sep 17 00:00:00 2001 From: Denis Gerasimov Date: Wed, 26 Mar 2025 18:29:38 +0300 Subject: [PATCH 1/2] [CLANG] Enable alignas after GNU attributes --- clang/l

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-03-28 Thread via cfe-commits
Sirraide wrote: Hmm, @erichkeane probably knows *where* this needs to be parsed then; I might take another look at this myself later (because I’m not sure either off the top of my head), but I’m rather busy today unfortunately... https://github.com/llvm/llvm-project/pull/133107 ___

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-03-28 Thread via cfe-commits
DenisGZM wrote: > At a glance this _does_ seem like the right place to do this, but this is > still missing a release note. > > It seems like GCC allows e.g. `__attribute__(()) alignas(16) int x` in any > case, so I don’t see why we shouldn’t allow this too. Can you also add some > tests that

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-03-27 Thread via cfe-commits
Sirraide wrote: CC @erichkeane in case there’s a specific reason I’m not aware of as to why we currently don’t allow this. https://github.com/llvm/llvm-project/pull/133107 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-03-27 Thread via cfe-commits
https://github.com/Sirraide commented: At a glance this *does* seem like the right place to do this, but this is still missing a release note. It seems like GCC allows e.g. `__attribute__(()) alignas(16) int x` in any case, so I don’t see why we shouldn’t allow this too. Can you also add some

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-03-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Denis.G (DenisGZM) Changes Enable parsing alignas attribute after GNU attributes, before ParseDeclaration This might be useful for cuda code where __shared__ and other specificators may be mixed with align. I'd be glad to see if there ar

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-03-26 Thread via cfe-commits
https://github.com/DenisGZM created https://github.com/llvm/llvm-project/pull/133107 Enable parsing alignas attribute after GNU attributes, before ParseDeclaration This might be useful for cuda code where __shared__ and other specificators may be mixed with align. I'd be glad to see if there