2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2009-06-30 06:33:26 +08:00
|
|
|
|
|
|
|
class S {
|
|
|
|
public:
|
|
|
|
S ();
|
|
|
|
};
|
|
|
|
|
|
|
|
struct D : S {
|
2010-03-31 00:19:37 +08:00
|
|
|
D() :
|
|
|
|
b1(0), // expected-note {{previous initialization is here}}
|
|
|
|
b2(1),
|
|
|
|
b1(0), // expected-error {{multiple initializations given for non-static member 'b1'}}
|
|
|
|
S(), // expected-note {{previous initialization is here}}
|
|
|
|
S() // expected-error {{multiple initializations given for base 'S'}}
|
|
|
|
{}
|
2009-06-30 06:33:26 +08:00
|
|
|
int b1;
|
|
|
|
int b2;
|
|
|
|
};
|
|
|
|
|
2010-03-31 00:19:37 +08:00
|
|
|
struct A {
|
|
|
|
struct {
|
|
|
|
int a;
|
|
|
|
int b;
|
|
|
|
};
|
|
|
|
A();
|
|
|
|
};
|
2009-06-30 06:33:26 +08:00
|
|
|
|
2010-03-31 00:19:37 +08:00
|
|
|
A::A() : a(10), b(20) { }
|