diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-22 09:06:26 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-22 09:06:26 +0000 |
commit | 2386c8b2211f3708cb475ffbcfb38df127559bb1 (patch) | |
tree | 0d6f683dad532c515677d3f2611959b912509a8b /clang/test/Parser/cxx0x-attributes.cpp | |
parent | 44c247f0f009eec70a193335c8a353d6f8602bfd (diff) | |
download | bcm5719-llvm-2386c8b2211f3708cb475ffbcfb38df127559bb1.tar.gz bcm5719-llvm-2386c8b2211f3708cb475ffbcfb38df127559bb1.zip |
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.
llvm-svn: 175876
Diffstat (limited to 'clang/test/Parser/cxx0x-attributes.cpp')
-rw-r--r-- | clang/test/Parser/cxx0x-attributes.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx0x-attributes.cpp b/clang/test/Parser/cxx0x-attributes.cpp index ac847a4893e..4e7ac16cc5d 100644 --- a/clang/test/Parser/cxx0x-attributes.cpp +++ b/clang/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(); |