summaryrefslogtreecommitdiff
path: root/test/Parser/cxx0x-attributes.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-12-28 21:23:03 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-12-28 21:23:03 +0000
commit55e6d896ad333f07bb3b1ba487df214fc268a4ab (patch)
tree9ac2087dfbe8507c56dd39d17cad42836448829f /test/Parser/cxx0x-attributes.cpp
parent1de93ee5610e8a97e753c881c574f8d994e71373 (diff)
Notes
svn path=/vendor/clang/dist/; revision=327302 svn path=/vendor/clang/clang-trunk-r321545/; revision=327322; tag=vendor/clang/clang-trunk-r321545
Diffstat (limited to 'test/Parser/cxx0x-attributes.cpp')
-rw-r--r--test/Parser/cxx0x-attributes.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/Parser/cxx0x-attributes.cpp b/test/Parser/cxx0x-attributes.cpp
index 4e3a2e4685e6..e01491db4133 100644
--- a/test/Parser/cxx0x-attributes.cpp
+++ b/test/Parser/cxx0x-attributes.cpp
@@ -64,6 +64,13 @@ struct MemberFnOrder {
struct [[]] struct_attr;
class [[]] class_attr {};
union [[]] union_attr;
+enum [[]] E { };
+namespace test_misplacement {
+[[]] struct struct_attr2; //expected-error{{misplaced attributes}}
+[[]] class class_attr2; //expected-error{{misplaced attributes}}
+[[]] union union_attr2; //expected-error{{misplaced attributes}}
+[[]] enum E2 { }; //expected-error{{misplaced attributes}}
+}
// Checks attributes placed at wrong syntactic locations of class specifiers.
class [[]] [[]]
@@ -91,7 +98,7 @@ class C final [[deprecated(l]] {}); // expected-error {{use of undeclared identi
class D final alignas ([l) {}]{}); // expected-error {{expected ',' or ']' in lambda capture list}} 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}}
+[[]] struct no_init_declarators; // expected-error {{misplaced attributes}}
template<typename> [[]] struct no_init_declarators_template; // expected-error {{an attribute list cannot appear here}}
void fn_with_structs() {
[[]] struct with_init_declarators {} init_declarator;