66 lines · cpp
1// RUN: %clang_cc1 -std=c++11 -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 A {7 A(...); // expected-note {{candidate constructor}}8 A(int = 0, int = 0, int = 0, int = 0, ...); // expected-note 3{{candidate constructor}} expected-note 2{{candidate inherited constructor}}9 A(int = 0, int = 0, ...); // expected-note 3{{candidate constructor}} expected-note 2{{candidate inherited constructor}}10 11 template<typename T> A(T, int = 0, ...);12 13 template<typename T, int N> A(const T (&)[N]); // expected-note {{candidate constructor}} expected-note {{candidate inherited constructor}}14 template<typename T, int N> A(const T (&)[N], int = 0); // expected-note {{candidate constructor}} expected-note {{candidate inherited constructor}}15};16 17struct B : A { // expected-note {{because base class 'A' has multiple default constructors}}18 using A::A; // expected-note 6{{inherited here}}19 B(void*);20};21 22struct C {} c;23 24A a0{}; // expected-error {{ambiguous}}25B b0{}; // expected-error {{deleted}}26 27A a1{1}; // expected-error {{ambiguous}}28B b1{1}; // expected-error {{ambiguous}}29 30A a2{1,2}; // expected-error {{ambiguous}}31B b2{1,2}; // expected-error {{ambiguous}}32 33A a3{1,2,3}; // ok34B b3{1,2,3}; // ok35 36A a4{1,2,3,4}; // ok37B b4{1,2,3,4}; // ok38 39A a5{1,2,3,4,5}; // ok40B b5{1,2,3,4,5}; // ok41 42A a6{c}; // ok43B b6{c}; // ok44 45A a7{c,0}; // ok46B b7{c,0}; // ok47 48A a8{c,0,1}; // ok49B b8{c,0,1}; // ok50 51A a9{"foo"}; // expected-error {{ambiguous}}52B b9{"foo"}; // expected-error {{ambiguous}}53 54namespace PR15755 {55 struct X {56 template<typename...Ts> X(int, Ts...);57 };58 struct Y : X {59 using X::X;60 };61 struct Z : Y {62 using Y::Y;63 };64 Z z(0);65}66