int a;
int a;
extern int a;
int a = 3;
int a = 3;
extern int a;
int a(3);
int a(3);
extern int a;
int a = 3, b, *c, d = 47;
int a = 3, b, *c, d=47;
extern int a, b, *c, d;
long long int a = 1;
long long int a = 1;
extern long long int a;
int a[64];
int a[64];
extern int a[64];
int a[] = {1, 2, 3};
int a[] = {1, 2, 3};
extern int a[3];
struct X {int a, b; }; X a[] = {{1, 2}, {3, 4}, {5, 6}};
X a[] = {{1, 2}, {3, 4}, {5, 6}};
struct X; struct X {int a, b; }; extern X a[3];
struct X {int a, b; }; X a[] = {{1, 2}, {3, 4}, {5, 6}, };
X a[] = {{1, 2}, {3, 4}, {5, 6}, };
struct X; struct X {int a, b; }; extern X a[3];
typedef int a;
typedef int a;
typedef int a, *b;
typedef int a, *b;
int typedef long a;
int typedef long a;
struct Thing { int a, b; char *c; };
struct Thing; struct Thing { int a, b; char *c; };
struct Thing { int a, b; char *c; }; struct Thang: Thing { float d; };
struct Thing; struct Thang; struct Thing { int a, b; char *c; }; struct Thang: Thing { float d; };
typedef struct b { int a; } b;
struct b; typedef struct b { int a; } b;
union Thing { int a, b; char *c; };
union Thing; union Thing { int a, b; char *c; };
typedef union Thing { int a, b; char *c; } d;
union Thing; typedef union Thing { int a, b; char *c; } d;
enum MyEnum { a, b, c=3, d };
enum MyEnum { a, b, c=3, d };
enum { a, b, c=3, d };
enum { a, b, c=3, d };
void stuff();
int fn(int a, char *b[]) { if (a || b[1]) { stuff(); } return b[2][0]; }
int fn(int a, char *b[]);
int fn(int a, char *b[]) { if (a || b[1]) { stuff(); } return b[2][0]; }
int fn(int a=1) { return a; }
int fn(int a=1);
int fn(int a) { return a; }
namespace ns { int a; void f() {} struct q { void m() {} }; }
namespace ns { extern int a; void f(); struct q; struct q { void m(); }; }
namespace ns { int a; void f() {} void q::m() {} }
namespace NS { struct S { void f() {} }; } namespace NS { struct T { void g() {} }; }
namespace NS { struct S; struct S { void f(); }; } namespace NS { struct T; struct T { void g(); }; }
namespace NS { void S::f() {} }
namespace NS { void T::g() {} }
namespace ns { namespace ns1 { int a; void f() {} struct q { void m() {} }; } }
namespace ns { namespace ns1 { extern int a; void f(); struct q; struct q { void m(); }; } }
namespace ns { namespace ns1 { int a; void f() {} void q::m() {} } }
struct q { void f() {}};
struct q; struct q { void f(); };
void q::f() {}
struct q { void f() const {}};
struct q; struct q { void f() const; };
void q::f() const {}
struct q { void f() && {}};
struct q; struct q { void f() &&; };
void q::f() && {}
struct q { void f() const && {}};
struct q; struct q { void f() const &&; };
void q::f() const && {}
struct S { static int a = 1; };
struct S; struct S { static int a; };
int S::a = 1;
struct S { static int a=1, b=2; };
struct S; struct S { static int a, b; };
int S::a = 1, S::b = 2;
struct S { static const int a = 1; };
struct S; struct S { static const int a; };
const int S::a = 1;
struct S { static const int a=1, b=2; };
struct S; struct S { static const int a, b; };
const int S::a = 1, S::b = 2;
class C { virtual void f() = 0; }; class D: C { virtual void f() override {} };
class C; class D; class C { virtual void f() = 0; }; class D: C { virtual void f() override; };
void D::f() {}
template<class T, class U> T f(U a) { return a; }
template<class T, class U> T f(U a); template<class T, class U> T f(U a) { return a; }
template<class T, class U> struct S { int q; int f() { return q; } };
template<class T, class U> struct S { int q; int f(); };
template<class T, class U> int S<T, U>::f() { return q; }
struct q { template<class T, class U> T f(U a) { return a; } };
struct q; struct q { template<class T, class U> T f(U a); };
template<class T, class U> T q::f(U a) { return a; }
template<class T> struct q { template<class R, class A> inline R f(A a) { return a; } };
template<class T> struct q { template<class R, class A> R f(A a) { return a; } };
class C { public: int p; protected: int pp; private: int ppp; };
class C; class C { public: int p; protected: int pp; private: int ppp; };
class C {}; class D: C {}; class E: public C {}; class F: protected C {}; class G: private C {}; class H: public D, protected E, private F {}; class I: public virtual C {};
class C; class D; class E; class F; class G; class H; class I; class C {}; class D: C {}; class E: public C {}; class F: protected C {}; class G: private C {}; class H: public D, protected E, private F {}; class I: public virtual C {};
enum class E { a, b=1, c };
enum class E { a, b=1, c };
enum class E: int { a, b=1, c };
enum class E: int { a, b=1, c };
typedef S<int> Sint; template<class T> struct S {};
template<class T> struct S {}; typedef S<int> Sint;
template<class T> struct S {}; typedef S<int> Sint;
template<class T> struct S {}; typedef S<int> Sint;
struct Thing { template<class T, class U> Thing(T t, U u) {} };
Thing myThing(“hi”, []() {});
extern Thing myThing;
Thing myThing(“hi”, []() {});
struct Thing { template<class T, class U> Thing(T t, U u) {} }; void blah(const char *);
Thing myThing(“hi”, []() { blah(“poo”); });
extern Thing myThing;
Thing myThing(“hi”, []() { blah(“poo”); });
struct Thing { template<class T, class U> Thing(T t, U u) {} }; void blah(const char *);
Thing myThing(“hi”, []() { blah(“))))”); int q = 4; });
extern Thing myThing;
Thing myThing(“hi”, []() { blah(“))))”); int q = 4; });
struct S { S &operator=(const S &) { return *this; } };
struct S; struct S { S &operator=(const S &); };
S &S::operator=(const S &) { return *this; }
struct S { operator int() { return 4; } };
struct S; struct S { operator int(); };
S::operator int() { return 4; }
struct S { int operator*(int i) { return 4; } };
struct S; struct S { int operator*(int i); };
int S::operator*(int i) { return 4; }
struct S { };
int operator*(int i, S &s) { return 4; }
struct S; struct S { };
int operator*(int i, S &s);
int operator*(int i, S &s) { return 4; }
struct S { void operator()(const S &) {} };
struct S; struct S { void operator()(const S &); };
void S::operator()(const S &) {}
struct S {}; void f(T) {} typedef S T;
struct S; struct S {}; typedef S T; void f(T);
void f(T) {}
struct S {}; T f() { return T(); } typedef S T;
struct S; struct S {}; typedef S T; T f();
T f() { return T(); }
struct S { int getX() { return 42; } __declspec(property(get=getX)) int x; };
struct S; struct S { int getX(); __declspec(property(get=getX)) int x; };
int S::getX() { return 42; }
struct S { int getX() { return 42; } void setX(int x) {} __declspec(property(get=getX,put=setX)) int x; };
struct S; struct S { int getX(); void setX(int x); __declspec(property(get=getX, put=setX)) int x; };
int S::getX() { return 42; } void S::setX(int x) {}
int __stdcall WindowProc() { return 0; }
int __stdcall WindowProc();
int __stdcall WindowProc() { return 0; }
struct S { static int __stdcall WindowProc() { return 0; } };
struct S; struct S { static int __stdcall WindowProc(); };
int __stdcall S::WindowProc() { return 0; }
constexpr int x = 4;
constexpr int x = 4;
struct S { static constexpr int x = 4; };
struct S; struct S { static constexpr int x = 4; };
constexpr int S::x;
Not valid C++; we allow it as a shorthand for static.
struct S { constexpr int x = 4; };
struct S; struct S { static constexpr int x = 4; };
constexpr int S::x;
struct S { constexpr int f() { return 4; } };
struct S; struct S { constexpr int f(); }; constexpr int S::f() { return 4; }
extern “C” int x;
extern “C” int x;
extern “C” int x;
extern “C” void f() {}
extern “C” void f();
extern “C” void f() {}
MyAttr int x;
MyAttr extern int x;
MyAttr int x;
MyAttr void f() {}
MyAttr void f();
MyAttr void f() {}
struct MyAttr s {};
struct s; struct MyAttr s {};
MyAttr enum e {};
MyAttr enum e {};
MyAttr enum class e {};
MyAttr enum class e {};
struct S { int a; int b:1, c:2; int d; int e:3; };
struct S; struct S { int a; int b:1, c:2; int d; int e:3; };
struct S { int (a): 1; };
struct S; struct S { int (a): 1; };
@interface MyClass { int myvar; } @end
@implementation MyClass -(int)myInstanceMethod:(int)myArg { return myArg; } +(int)myClassMethod:(int)myArg { return myArg; } @end
@class MyClass; @interface MyClass { int myvar; } -(int)myInstanceMethod:(int)myArg; +(int)myClassMethod:(int)myArg; @end
@implementation MyClass -(int)myInstanceMethod:(int)myArg { return myArg; } +(int)myClassMethod:(int)myArg { return myArg; } @end
int a = 1; // int b = 2; int c = 3; // int d1 = 4; // int d2 = 4; int e = 5;
extern int a; extern int c; extern int e;
int a = 1; int c = 3; int e = 5;
int a = 1; * int b1 = 2; int b2 = 2; * int c = 3; /* int d0 = 4; int d1 = 4; int d2 = 4; */ int e = 5;
extern int a; extern int c; extern int e;
int a = 1; int c = 3; int e = 5;
#pragma depends Thing
int a = 1; #line 50 “ZAG” int b = 2;
extern int a; extern int b;
int a = 1; int b = 2;
int a = 1;
int b = 2;
extern int a; extern int b;
int a = 1; int b = 2;