// RUN: %clang_cc1 -fsyntax-only -verify %s // Make sure that copy constructors and assignment operators are properly // generated when there is a matching // PR5072 template struct X { template X(const X& other) : value(other.value + 1) { } // expected-error{{binary expression}} template X& operator=(const X& other) { value = other.value + 1; // expected-error{{binary expression}} return *this; } T value; }; struct Y {}; X test0(X x) { return x; } X test1(X x) { return x; } X test2(X x) { return x; // expected-note{{instantiation}} } void test3(X &x, X xi, X xl, X xmptr) { x = xi; x = xl; x = xmptr; // expected-note{{instantiation}} } struct X1 { X1 &operator=(const X1&); }; template struct X2 : X1 { template X2 &operator=(const U&); }; struct X3 : X2 { }; void test_X2(X3 &to, X3 from) { to = from; }