summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/class-base-member-init.cpp
blob: 1c6e79012ea511215088ebb147bd3fdb7c315afd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// RUN: %clang_cc1 -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 'S'}} \
                                         // expected-note {{previous initialization is here}}

  int b1;
  int b2;

};


OpenPOWER on IntegriCloud