================ @@ -2,3 +2,26 @@ _Alignas(int) struct c1; // expected-warning {{'_Alignas' attribute ignored}} alignas(int) struct c1; // expected-warning {{'alignas' attribute ignored}} + + +__attribute__(()) [[]] alignas(int) int a; // expected-none TODO: actually this line should be an error +__attribute__(()) alignas(int) [[]] int b; // expected-error {{an attribute list cannot appear here}} +__attribute__(()) alignas(int) int c; // expected-none +[[]] __attribute__(()) alignas(int) int d; // expected-none +alignas(int) [[]] __attribute__(()) int e; // expected-error {{an attribute list cannot appear here}} + +struct C1 { + __attribute__(()) [[]] alignas(int) int a; // expected-error {{an attribute list cannot appear here}} + __attribute__(()) alignas(int) [[]] int b; // expected-error {{an attribute list cannot appear here}} + __attribute__(()) alignas(int) int c; // expected-none + [[]] __attribute__(()) alignas(int) int d; // expected-none + alignas(int) [[]] __attribute__(()) int e; // expected-error {{an attribute list cannot appear here}} +}; + +void fn_with_decl() { + __attribute__(()) [[]] alignas(int) int a; // expected-error {{an attribute list cannot appear here}} + __attribute__(()) alignas(int) [[]] int b; // expected-error {{an attribute list cannot appear here}} + __attribute__(()) alignas(int) int c; // expected-none + [[]] __attribute__(()) alignas(int) int d; // expected-none + alignas(int) [[]] __attribute__(()) int e; // expected-error {{an attribute list cannot appear here}} +} ---------------- AaronBallman wrote:
Can you add a newline to the end of the file? 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