1 | // RUN: %clang_cc1 -std=c++98 %s -fsyntax-only |
2 | // RUN: %clang_cc1 -std=c++11 %s -verify |
3 | |
4 | // In C++11, we must perform overload resolution to determine which function is |
5 | // called by a defaulted assignment operator, and the selected operator might |
6 | // not be a copy or move assignment (it might be a specialization of a templated |
7 | // 'operator=', for instance). |
8 | struct 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 | |
15 | struct B : A { |
16 | B &operator=(B &&); |
17 | }; |
18 | |
19 | B &B::operator=(B &&) = default; // expected-note {{here}} |
20 | |