1 // RUN: %clang_cc1 -fsyntax-only -Wreorder -verify %s
7 class complex : public BB, BB1 {
10 : s2(1), // expected-warning {{field 's2' will be initialized after field 's1'}}
12 s3(3), // expected-warning {{field 's3' will be initialized after base 'BB1'}}
13 BB1(), // expected-warning {{base class 'BB1' will be initialized after base 'BB'}}
22 // testing virtual bases.
29 struct A : public virtual V {
33 struct B : public virtual V {
37 struct Diamond : public A, public B {
38 Diamond() : A(), B() {}
42 struct C : public A, public B, private virtual V {
47 struct D : public A, public B {
48 D() : A(), V() { } // expected-warning {{base class 'A' will be initialized after base 'V'}}
52 struct E : public A, public B, private virtual V {
53 E() : A(), V() { } // expected-warning {{base class 'A' will be initialized after base 'V'}}
65 struct F : public A1, public B1, private virtual V {
66 F() : A1(), V() { } // expected-warning {{base class 'A1' will be initialized after base 'V'}}
69 struct X : public virtual A, virtual V, public virtual B {
70 X(): A(), V(), B() {} // expected-warning {{base class 'A' will be initialized after base 'V'}}
74 int c; union {int a,b;}; int d;
75 Anon() : c(10), b(1), d(2) {}
78 int c; union {int a,b;}; int d;
80 d(10), // expected-warning {{field 'd' will be initialized after field 'b'}}
91 struct S2: virtual S1 { };
94 struct S4: virtual S3, S2 {
95 S4() : S2(), // expected-warning {{base class 'T1::S2' will be initialized after base 'T1::S3'}}
101 struct Foo { Foo(); };
103 template <class T> A(T *t) :
104 y(), // expected-warning {{field 'y' will be initialized after field 'x'}}
112 // PR6575: this should not crash
115 MyClass() : m_int(0) {}
129 template <class T> Y(T x) : X(x) { }