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