blob: f863bd198e507acda27fb9e001bb05cf753abbbf [file] [log] [blame]
Douglas Gregor8a4db832011-01-19 16:41:58 +00001// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
Sebastian Redlf4485de2008-11-08 15:40:37 +00002class C;
Argyrios Kyrtzidis7bbb20e2008-06-24 22:12:16 +00003class C {
4public:
5protected:
6 typedef int A,B;
7 static int sf(), u;
8
9 struct S {};
Douglas Gregoraa8c9722010-07-13 06:24:26 +000010 enum {}; // expected-warning{{declaration does not declare anything}}
Douglas Gregorf19ac0e2010-04-08 21:33:23 +000011 int; // expected-warning {{declaration does not declare anything}}
Argyrios Kyrtzidisf4ebe9e2008-06-28 08:10:48 +000012 int : 1, : 2;
Argyrios Kyrtzidis7bbb20e2008-06-24 22:12:16 +000013
14public:
15 void m() {
16 int l = 2;
Douglas Gregor8a4db832011-01-19 16:41:58 +000017 };
18
19 template<typename T> void mt(T) { };
20 ; // expected-warning{{extra ';' inside a class}}
21
Sebastian Redlf4485de2008-11-08 15:40:37 +000022 virtual int vf() const volatile = 0;
Argyrios Kyrtzidis7bbb20e2008-06-24 22:12:16 +000023
24private:
25 int x,f(),y,g();
Sebastian Redlf4485de2008-11-08 15:40:37 +000026 inline int h();
27 static const int sci = 10;
Sebastian Redlccdfaba2008-11-14 23:42:31 +000028 mutable int mi;
Argyrios Kyrtzidis7bbb20e2008-06-24 22:12:16 +000029};
Sebastian Redlf4485de2008-11-08 15:40:37 +000030void glo()
31{
32 struct local {};
33}
Chris Lattnerd19c1c02008-12-18 01:12:00 +000034
35// PR3177
36typedef union {
37 __extension__ union {
38 int a;
39 float b;
40 } y;
41} bug3177;
42