================ @@ -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 { __attribute__((deprecated)) alignas(16) int x; }; // expected-none ---------------- AaronBallman wrote:
I'd like to see a test case like which shows the various combinations of orders we can handle (no need to test `struct` and `class` separately as those follow the same code paths). ``` class C { __attribute__(()) [[]] alignas(int) int x; __attribute__(()) alignas(int) [[]] int y; [[]] __attribute__(()) alignas(int) int z; alignas(int) [[]] __attribute__(()) int a; }; ``` We should also be sure to test this in C23 mode to make sure we get the same behavior in C as well as in C++. 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