1 // RUN: %clang_cc1 -std=c++11 -verify %s
4 B1(int); // expected-note {{candidate}}
8 B2(int); // expected-note {{candidate}}
12 using B1::B1
; // expected-note {{inherited here}}
13 using B2::B2
; // expected-note {{inherited here}}
15 D1
d1(0); // expected-error {{ambiguous}}
25 // The emergent behavior of implicit special members is a bit odd when
26 // inheriting from multiple base classes.
27 namespace default_ctor
{
31 struct convert_to_D1
{
34 struct convert_to_D2
{
45 D
&operator=(D
&&); // expected-note {{candidate}}
47 A(convert_to_D2
); // expected-note {{candidate}}
57 D
&operator=(D
&&); // expected-note {{candidate}}
59 B(convert_to_D2
); // expected-note {{candidate}}
69 using A::A
; // expected-note {{inherited here}}
71 using B::B
; // expected-note {{inherited here}}
76 D
&operator=(const D
&);
81 C
c2(static_cast<C
&&>(c
));
82 c
= static_cast<C
&&>(c
);
85 // D does not declare D(), D(D&&), nor operator=(D&&), so the base class
86 // versions are inherited.
87 // Exception: we implicitly declare a default constructor so that we can
88 // reason about its properties.
89 D d
; // ok, implicitly declared
91 D
d2(static_cast<D
&&>(d
)); // ok, ignores inherited constructors
92 D
d3(convert_to_D1
{}); // ok, ignores inherited constructors
93 D
d4(convert_to_D2
{}); // expected-error {{ambiguous}}
94 d
= static_cast<D
&&>(d
); // expected-error {{ambiguous}}
100 X(volatile Y
&); // expected-note 3{{inherited constructor cannot be used to copy object}}
102 struct Y
: X
{ using X::X
; } volatile y
;
103 struct Z
: Y
{ using Y::Y
; } volatile z
; // expected-note 4{{no known conversion}} expected-note 2{{would lose volatile}} expected-note 3{{requires 0}} expected-note 3{{inherited here}}
104 Z
z1(x
); // expected-error {{no match}}
105 Z
z2(y
); // expected-error {{no match}}
106 Z
z3(z
); // expected-error {{no match}}