[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CXX / special / class.copy / p28-cxx11.cpp
blobdc501d91f713acfbbac5b42167cfbace6de88f24
1 // RUN: %clang_cc1 -std=c++98 %s -fsyntax-only
2 // RUN: %clang_cc1 -std=c++11 %s -verify
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 &);
11 template<typename T>
12 A &operator=(T &&) { return T::error; } // expected-error {{no member named 'error' in 'A'}}
15 struct B : A {
16 B &operator=(B &&);
19 B &B::operator=(B &&) = default; // expected-note {{here}}