summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/cxx11-base-spec-attributes.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-02-19 23:47:15 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-02-19 23:47:15 +0000
commit4c96e99235b32b594abaf93e5c16c81aae7acb3c (patch)
tree4d1dd07e61150390848ff4436b8e68c492b076cd /clang/test/Parser/cxx11-base-spec-attributes.cpp
parent9d6f7037ba7067b850a2abaf65be0b8d08ff134c (diff)
downloadbcm5719-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/Parser/cxx11-base-spec-attributes.cpp')
-rw-r--r--clang/test/Parser/cxx11-base-spec-attributes.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx11-base-spec-attributes.cpp b/clang/test/Parser/cxx11-base-spec-attributes.cpp
new file mode 100644
index 00000000000..7338c5116c1
--- /dev/null
+++ b/clang/test/Parser/cxx11-base-spec-attributes.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -std=c++11 %s -verify
+
+struct A {};
+struct B : [[]] A {};
+struct C : [[]] virtual A {};
+struct D : [[]] public virtual A {};
+struct E : public [[]] virtual A {}; // expected-error {{an attribute list cannot appear here}}
+struct F : virtual [[]] public A {}; // expected-error {{an attribute list cannot appear here}}
+struct G : [[noreturn]] A {}; // expected-error {{'noreturn' attribute cannot be applied to a base specifier}}
+struct H : [[unknown::foobar]] A {}; // expected-warning {{unknown attribute 'foobar' ignored}}
OpenPOWER on IntegriCloud