xref: /llvm-project/clang/test/Parser/cxx11-base-spec-attributes.cpp (revision 4c96e99235b32b594abaf93e5c16c81aae7acb3c)
1*4c96e992SRichard Smith // RUN: %clang_cc1 -std=c++11 %s -verify
2*4c96e992SRichard Smith 
3*4c96e992SRichard Smith struct A {};
4*4c96e992SRichard Smith struct B : [[]] A {};
5*4c96e992SRichard Smith struct C : [[]] virtual A {};
6*4c96e992SRichard Smith struct D : [[]] public virtual A {};
7*4c96e992SRichard Smith struct E : public [[]] virtual A {}; // expected-error {{an attribute list cannot appear here}}
8*4c96e992SRichard Smith struct F : virtual [[]] public A {}; // expected-error {{an attribute list cannot appear here}}
9*4c96e992SRichard Smith struct G : [[noreturn]] A {}; // expected-error {{'noreturn' attribute cannot be applied to a base specifier}}
10*4c96e992SRichard Smith struct H : [[unknown::foobar]] A {}; // expected-warning {{unknown attribute 'foobar' ignored}}
11