From 4c96e99235b32b594abaf93e5c16c81aae7acb3c Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 19 Feb 2013 23:47:15 +0000 Subject: PR15300: Support C++11 attributes on base-specifiers. We don't support any such attributes yet, so just issue the appropriate diagnostics. Also generalize the fixit for attributes-in-the-wrong-place code and reuse it here, if attributes are placed after the access-specifier or 'virtual' in a base specifier. llvm-svn: 175575 --- clang/test/FixIt/fixit-cxx11-attributes.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'clang/test/FixIt/fixit-cxx11-attributes.cpp') diff --git a/clang/test/FixIt/fixit-cxx11-attributes.cpp b/clang/test/FixIt/fixit-cxx11-attributes.cpp index 7c8efcb8ec7..f28bdfc7cd9 100644 --- a/clang/test/FixIt/fixit-cxx11-attributes.cpp +++ b/clang/test/FixIt/fixit-cxx11-attributes.cpp @@ -32,3 +32,20 @@ namespace ClassSpecifier { // CHECK: fix-it:{{.*}}:{27:19-27:19} // CHECK: fix-it:{{.*}}:{29:5-29:31} } + +namespace BaseSpecifier { + struct base1 {}; + struct base2 {}; + class with_base_spec : public [[a]] // expected-error {{an attribute list cannot appear here}} expected-warning {{unknown}} + // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:26-[[@LINE-1]]:26}:"[{{\[}}a]]" + // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:33-[[@LINE-2]]:39}:"" + virtual [[b]] base1, // expected-error {{an attribute list cannot appear here}} expected-warning {{unknown}} + // CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:26-[[@LINE-4]]:26}:"[{{\[}}b]]" + // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:34-[[@LINE-2]]:40}:"" + virtual [[c]] // expected-error {{an attribute list cannot appear here}} expected-warning {{unknown}} + // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:26-[[@LINE-1]]:26}:"[{{\[}}c]]" + // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:34-[[@LINE-2]]:40}:"" + public [[d]] base2 {}; // expected-error {{an attribute list cannot appear here}} expected-warning {{unknown}} + // CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:26-[[@LINE-4]]:26}:"[{{\[}}d]]" + // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:33-[[@LINE-2]]:39}:"" +} -- cgit v1.2.3