diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-19 23:47:15 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-19 23:47:15 +0000 |
commit | 4c96e99235b32b594abaf93e5c16c81aae7acb3c (patch) | |
tree | 4d1dd07e61150390848ff4436b8e68c492b076cd /clang/test/FixIt/fixit-cxx11-attributes.cpp | |
parent | 9d6f7037ba7067b850a2abaf65be0b8d08ff134c (diff) | |
download | bcm5719-llvm-4c96e99235b32b594abaf93e5c16c81aae7acb3c.tar.gz bcm5719-llvm-4c96e99235b32b594abaf93e5c16c81aae7acb3c.zip |
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
Diffstat (limited to 'clang/test/FixIt/fixit-cxx11-attributes.cpp')
-rw-r--r-- | clang/test/FixIt/fixit-cxx11-attributes.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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}:"" +} |