aboutsummaryrefslogtreecommitdiff
path: root/test/Parser/cxx0x-attributes.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-02-22 09:06:26 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-02-22 09:06:26 +0000
commit68ea3aeff1be9412658f4c96fdab0d8ad875be6c (patch)
tree48a250d8a4aed03972981c8f8cc501247be19a6c /test/Parser/cxx0x-attributes.cpp
parentf6565a9f7318b1ca6ea9510003dde7b89696daab (diff)
Per the grammar in [dcl.dcl]p1, a simple-declaration can only have attributes
if it has declarators. We were missing the check for this in a couple of places. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175876 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/cxx0x-attributes.cpp')
-rw-r--r--test/Parser/cxx0x-attributes.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/Parser/cxx0x-attributes.cpp b/test/Parser/cxx0x-attributes.cpp
index ac847a4893..4e7ac16cc5 100644
--- a/test/Parser/cxx0x-attributes.cpp
+++ b/test/Parser/cxx0x-attributes.cpp
@@ -88,6 +88,11 @@ class [[]] [[]] final_class_another
[[]] struct with_init_declarators {} init_declarator;
[[]] struct no_init_declarators; // expected-error {{an attribute list cannot appear here}}
+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;
+ [[]] struct no_init_declarators; // expected-error {{an attribute list cannot appear here}}
+}
[[]];
struct ctordtor {
[[]] ctordtor();