49 lines · cpp
1// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s2//3// Note: [class.inhctor] was removed by P0136R1. This tests the new behavior4// for the wording that used to be there.5 6struct B1 {7 B1(int); // expected-note {{candidate}}8};9struct B2 {10 B2(int); // expected-note {{candidate}}11};12struct D1 : B1, B2 {13 using B1::B1; // expected-note {{inherited here}}14 using B2::B2; // expected-note {{inherited here}}15};16struct D2 : B1, B2 {17 using B1::B1;18 using B2::B2;19 D2(int);20};21D1 d1(0); // expected-error {{ambiguous}}22D2 d2(0);23 24template<typename T> struct B3 {25 B3(T);26};27template<typename T> struct B4 : B3<T>, B1 {28 B4();29 using B3<T>::B3;30 using B1::B1;31};32B4<char> b4c;33B4<int> b4i;34 35struct B5 {36 template<typename T> B5(T);37};38struct D6 : B5 {39 using B5::B5;40 template<typename T> D6(T);41};42D6 d6(0);43struct D7 : B5 {44 using B5::B5;45 template<typename T> D7(T, ...);46};47// DRxxx (no number yet): derived class ctor beats base class ctor.48D7 d7(0);49