1 // RUN: %clang_cc1 -std=c++11 -verify %s
3 template<int> struct X {};
5 // A[n inheriting] constructor [...] has the same access as the corresponding
6 // constructor [in the base class].
13 A(X<2>) {} // expected-note {{declared private here}}
18 using A::A; // expected-error {{private constructor}} expected-note {{implicitly declared protected here}}
23 B b1{X<1>{}}; // expected-error {{calling a protected constructor}}
24 B b2{X<2>{}}; // expected-note {{first required here}}
37 using A::A; // expected-note 2{{here}}
40 FA fa1{X<1>{}}; // expected-error {{calling a protected constructor}}
41 FA fa2{X<2>{}}; // expected-error {{calling a private constructor}}
44 // It is deleted if the corresponding constructor [...] is deleted.
47 template<typename T> G(T*) = delete;
50 using G::G; // expected-note 2{{marked deleted here}}
52 H h1(5); // expected-error {{call to implicitly-deleted function of 'H'}}
53 H h2("foo"); // expected-error {{call to deleted constructor of 'H'}}
56 // Core defect: It is also deleted if multiple base constructors generate the
60 constexpr A(int, float = 0) {}
61 explicit A(int, int = 0) {}
63 A(int, int, int = 0) = delete;
66 // FIXME: produce notes indicating why it was deleted
67 using A::A; // expected-note {{here}}
70 constexpr B b0(0, 0.0f); // ok, constexpr
71 B b1(0, 1); // expected-error {{call to implicitly-deleted}}