================
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+template<class T, class V>
+struct A{
+    A();
+    A(A&);
+    A(A<V, T>); // expected-error{{copy constructor must pass its first 
argument by reference}}
+};
+
+void f() {
+    A<int, int> a = A<int, int>(); // expected-note{{in instantiation of 
template class 'A<int, int>'}}
+}
+
+template<class T, class V>
+struct B{
+    B();
+    template<class U> B(U); // No error (templated constructor)
+};
+
+void g() {
+    B<int, int> b = B<int, int>(); // should use implicit copy constructor
+}
----------------
Megan0704-1 wrote:

Thanks for the review! I’ll add tests for the A<int, double> case and update 
the PR shortly.

https://github.com/llvm/llvm-project/pull/130866
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to