1 // RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s 2 class C; 3 class C { 4 public: 5 protected: 6 typedef int A,B; 7 static int sf(), u; 8 9 struct S {}; 10 enum {}; // expected-warning{{declaration does not declare anything}} 11 int; // expected-warning {{declaration does not declare anything}} 12 int : 1, : 2; 13 14 public: 15 void m() { 16 int l = 2; 17 }; 18 19 template<typename T> void mt(T) { }; 20 ; // expected-warning{{extra ';' inside a class}} 21 22 virtual int vf() const volatile = 0; 23 24 private: 25 int x,f(),y,g(); 26 inline int h(); 27 static const int sci = 10; 28 mutable int mi; 29 }; 30 void glo() 31 { 32 struct local {}; 33 } 34 35 // PR3177 36 typedef union { 37 __extension__ union { 38 int a; 39 float b; 40 } y; 41 } bug3177; 42 43 // check that we don't consume the token after the access specifier 44 // when it's not a colon 45 class D { 46 public // expected-error{{expected ':'}} 47 int i; 48 }; 49 50 // consume the token after the access specifier if it's a semicolon 51 // that was meant to be a colon 52 class E { 53 public; // expected-error{{expected ':'}} 54 int i; 55 }; 56 57 class F { 58 int F1 { return 1; } // expected-error{{function definition does not declare parameters}} 59 void F2 {} // expected-error{{function definition does not declare parameters}} 60 typedef int F3() { return 0; } // expected-error{{function definition declared 'typedef'}} 61 typedef void F4() {} // expected-error{{function definition declared 'typedef'}} 62 }; 63 64 // PR11109 must appear at the end of the source file 65 class pr11109r3 { // expected-note{{to match this '{'}} 66 public // expected-error{{expected ':'}} expected-error{{expected '}'}} expected-error{{expected ';' after class}} 67