From 2386c8b2211f3708cb475ffbcfb38df127559bb1 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 22 Feb 2013 09:06:26 +0000 Subject: 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 --- clang/test/Parser/cxx0x-attributes.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/test/Parser/cxx0x-attributes.cpp') 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 [[]] 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(); -- cgit v1.2.3