xref: /llvm-project/clang/test/CXX/special/class.inhctor/p7.cpp (revision 70f59b5bbc84d195b4c7ee1597dcae4e73d3c479)
19ca5c425SRichard Smith // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
25179eb78SRichard Smith //
35179eb78SRichard Smith // Note: [class.inhctor] was removed by P0136R1. This tests the new behavior
45179eb78SRichard Smith // for the wording that used to be there.
50890502fSSebastian Redl 
6836a3b41SRichard Smith struct B1 {
75179eb78SRichard Smith   B1(int); // expected-note {{candidate}}
80890502fSSebastian Redl };
9836a3b41SRichard Smith struct B2 {
105179eb78SRichard Smith   B2(int); // expected-note {{candidate}}
110890502fSSebastian Redl };
12*70f59b5bSRichard Smith struct D1 : B1, B2 {
13836a3b41SRichard Smith   using B1::B1; // expected-note {{inherited here}}
14836a3b41SRichard Smith   using B2::B2; // expected-note {{inherited here}}
150890502fSSebastian Redl };
160890502fSSebastian Redl struct D2 : B1, B2 {
17c2bc61b0SRichard Smith   using B1::B1;
18c2bc61b0SRichard Smith   using B2::B2;
190890502fSSebastian Redl   D2(int);
200890502fSSebastian Redl };
215179eb78SRichard Smith D1 d1(0); // expected-error {{ambiguous}}
225179eb78SRichard Smith D2 d2(0);
2323d55873SRichard Smith 
2423d55873SRichard Smith template<typename T> struct B3 {
255179eb78SRichard Smith   B3(T);
2623d55873SRichard Smith };
2723d55873SRichard Smith template<typename T> struct B4 : B3<T>, B1 {
2823d55873SRichard Smith   B4();
295179eb78SRichard Smith   using B3<T>::B3;
305179eb78SRichard Smith   using B1::B1;
3123d55873SRichard Smith };
3223d55873SRichard Smith B4<char> b4c;
335179eb78SRichard Smith B4<int> b4i;
34185be185SRichard Smith 
35185be185SRichard Smith struct B5 {
365179eb78SRichard Smith   template<typename T> B5(T);
37185be185SRichard Smith };
385179eb78SRichard Smith struct D6 : B5 {
39185be185SRichard Smith   using B5::B5;
405179eb78SRichard Smith   template<typename T> D6(T);
41185be185SRichard Smith };
425179eb78SRichard Smith D6 d6(0);
435179eb78SRichard Smith struct D7 : B5 {
445179eb78SRichard Smith   using B5::B5;
455179eb78SRichard Smith   template<typename T> D7(T, ...);
465179eb78SRichard Smith };
475179eb78SRichard Smith // DRxxx (no number yet): derived class ctor beats base class ctor.
485179eb78SRichard Smith D7 d7(0);
49