aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/class-base-member-init.cpp
blob: 2092847bc02d5c9c3ed586736ae4a94a9eaf2ae8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// RUN: clang-cc -fsyntax-only -verify %s

class S {
public:
  S (); 
};

struct D : S {
  D() : b1(0), b2(1), b1(0), S(), S() {} // expected-error {{multiple initializations given for non-static member 'b1'}} \
                                         // expected-note {{previous initialization is here}}                  \
                                         // expected-error {{multiple initializations given for base 'class S'}} \
                                         // expected-note {{previous initialization is here}}

  int b1;
  int b2;

};