diff options
Diffstat (limited to 'clang/test/Parser/cxx0x-attributes.cpp')
-rw-r--r-- | clang/test/Parser/cxx0x-attributes.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx0x-attributes.cpp b/clang/test/Parser/cxx0x-attributes.cpp index 58e42bffcff..54baaedfd39 100644 --- a/clang/test/Parser/cxx0x-attributes.cpp +++ b/clang/test/Parser/cxx0x-attributes.cpp @@ -62,6 +62,29 @@ struct MemberFnOrder { struct [[]] struct_attr; class [[]] class_attr {}; union [[]] union_attr; + +// Checks attributes placed at wrong syntactic locations of class specifiers. +// FIXME: provide fix-it hint. +class [[]] [[]] + attr_after_class_name_decl [[]] [[]]; // expected-error {{an attribute list cannot appear here}} + +class [[]] [[]] + attr_after_class_name_definition [[]] [[]] [[]]{}; // expected-error {{an attribute list cannot appear here}} + +class [[]] c {}; +class c [[]] [[]] x; +class c [[]] [[]] y [[]] [[]]; +class c final [(int){0}]; + +class base {}; +class [[]] [[]] final_class + alignas(float) [[]] final // expected-error {{an attribute list cannot appear here}} + alignas(float) [[]] [[]] alignas(float): base{}; // expected-error {{an attribute list cannot appear here}} + +class [[]] [[]] final_class_another + [[]] [[]] alignas(16) final // expected-error {{an attribute list cannot appear here}} + [[]] [[]] alignas(16) [[]]{}; // expected-error {{an attribute list cannot appear here}} + [[]] struct with_init_declarators {} init_declarator; [[]] struct no_init_declarators; // expected-error {{an attribute list cannot appear here}} [[]]; |