Douglas Gregor | e37ac4f | 2008-04-13 21:30:24 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | class A { }; |
| 3 | |
| 4 | class B1 : A { }; |
| 5 | |
| 6 | class B2 : virtual A { }; |
| 7 | |
| 8 | class B3 : virtual virtual A { }; // expected-error{{duplicate 'virtual' in base specifier}} |
| 9 | |
| 10 | class C : public B1, private B2 { }; |
| 11 | |
| 12 | |
| 13 | class D; |
| 14 | |
| 15 | class E : public D { }; // expected-error{{base class has incomplete type}} |
| 16 | |
| 17 | typedef int I; |
| 18 | |
| 19 | class F : public I { }; // expected-error{{base specifier must name a class}} |
| 20 | |
| 21 | union U1 : public A { }; // expected-error{{unions cannot have base classes}} |
| 22 | |
| 23 | union U2 {}; |
| 24 | |
| 25 | class G : public U2 { }; // expected-error{{unions cannot be base classes}} |