1 // RUN: %clang_cc1 -fsyntax-only -verify=expected,precxx17 %std_cxx98-14 %s
2 // RUN: %clang_cc1 -fsyntax-only -verify=expected %std_cxx17- %s
34 // Test reference binding via an lvalue conversion function.
40 // Test conversion followed by copy-construction
44 Base(const FunkyDerived
&);
47 struct Derived
: Base
{ };
49 struct FunkyDerived
: Base
{ };
51 struct ConvertibleToBase
{
55 struct ConvertibleToDerived
{
59 struct ConvertibleToFunkyDerived
{
60 operator FunkyDerived();
63 void test_conversion(ConvertibleToBase ctb
, ConvertibleToDerived ctd
,
64 ConvertibleToFunkyDerived ctfd
) {
73 X1(X1
&); // precxx17-note{{candidate constructor not viable: expects an lvalue for 1st argument}}
84 int &ir
= f(b
); // precxx17-error{{no viable constructor copying parameter of type 'X1'}}
87 namespace rdar10202900
{
93 A(int i
); // expected-note{{declared private here}}
98 a
= b
; // expected-error{{calling a private constructor of class 'rdar10202900::A'}}