Add implicitly-declared default and copy constructors to C++ classes,
when appropriate.
Conversions for class types now make use of copy constructors. I've
replaced the egregious hack allowing class-to-class conversions with a
slightly less egregious hack calling these conversions standard
conversions (for overloading reasons).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58622 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/overload-call-copycon.cpp b/test/SemaCXX/overload-call-copycon.cpp
new file mode 100644
index 0000000..8270928
--- /dev/null
+++ b/test/SemaCXX/overload-call-copycon.cpp
@@ -0,0 +1,38 @@
+// RUN: clang -fsyntax-only %s
+class X { };
+
+int& copycon(X x);
+float& copycon(...);
+
+void test_copycon(X x, X const xc, X volatile xv) {
+ int& i1 = copycon(x);
+ int& i2 = copycon(xc);
+ float& f1 = copycon(xv);
+}
+
+class A {
+public:
+ A(A&);
+};
+
+class B : public A { };
+
+short& copycon2(A a);
+int& copycon2(B b);
+float& copycon2(...);
+
+void test_copycon2(A a, const A ac, B b, B const bc, B volatile bv) {
+ int& i1 = copycon2(b);
+ float& f1 = copycon2(bc);
+ float& f2 = copycon2(bv);
+ short& s1 = copycon2(a);
+ float& f3 = copycon2(ac);
+}
+
+int& copycon3(A a);
+float& copycon3(...);
+
+void test_copycon3(B b, const B bc) {
+ int& i1 = copycon3(b);
+ float& f1 = copycon3(bc);
+}