20 lines · cpp
1// RUN: %clang_cc1 -std=c++98 %s -fsyntax-only2// RUN: %clang_cc1 -std=c++11 %s -verify3 4// In C++11, we must perform overload resolution to determine which function is5// called by a defaulted assignment operator, and the selected operator might6// not be a copy or move assignment (it might be a specialization of a templated7// 'operator=', for instance).8struct A {9 A &operator=(const A &);10 11 template<typename T>12 A &operator=(T &&) { return T::error; } // expected-error {{no member named 'error' in 'A'}}13};14 15struct B : A {16 B &operator=(B &&);17};18 19B &B::operator=(B &&) = default; // expected-note {{here}}20