================
@@ -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
+}
----------------
cor3ntin wrote:

Can you add a test for @hubert-reinterpretcast comment here
https://github.com/llvm/llvm-project/issues/80963#issuecomment-2716322960

Can you add tests for something like
`A<int, double> a = A<double, int>();` // not a copy constructor


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