blob: 0821c34b02c359e34a9d79545e2049c3688e0229 [file] [log] [blame]
Daniel Dunbar8fbe78f2009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Fariborz Jahanian2be8bf42009-06-29 22:33:26 +00002
3class S {
4public:
5 S ();
6};
7
8struct D : S {
Anders Carlsson83ac3122010-03-30 16:19:37 +00009 D() :
10 b1(0), // expected-note {{previous initialization is here}}
11 b2(1),
12 b1(0), // expected-error {{multiple initializations given for non-static member 'b1'}}
13 S(), // expected-note {{previous initialization is here}}
14 S() // expected-error {{multiple initializations given for base 'S'}}
15 {}
Fariborz Jahanian2be8bf42009-06-29 22:33:26 +000016 int b1;
17 int b2;
Fariborz Jahanian2be8bf42009-06-29 22:33:26 +000018};
19
Anders Carlsson83ac3122010-03-30 16:19:37 +000020struct A {
21 struct {
22 int a;
23 int b;
24 };
25 A();
26};
Fariborz Jahanian2be8bf42009-06-29 22:33:26 +000027
Anders Carlsson83ac3122010-03-30 16:19:37 +000028A::A() : a(10), b(20) { }