1 // PR c++/101165 - P2266R1 - Simpler implicit move
2 // { dg-do compile { target c++20 } }
3 // Test from P2266R1, $ 3.3. Two overload resolutions are overly confusing.
12 Frodo(Widget&&) = delete;
16 Sam(Widget&) = delete; // #1
17 Sam(const Widget&); // #2
22 // This is supposed to call #2 since C++20 because P1155.
23 // But we actually choose #1 since r11-2411 (in C++20 only).
24 return w; // { dg-error "deleted" "" { target c++20_only } }
29 // This is a correct error in both C++20 and C++23.
30 return w; // { dg-error "use of deleted function" }
35 struct Together : Merry, Pippin {};
44 // C++20: calls Quest(Together&). Proposed: ill-formed.
45 return t; // { dg-error "ambiguous" "" { target c++23 } }