[gcn] install.texi: Update for new ISA targets and their requirements
[gcc.git] / gcc / testsuite / g++.dg / cpp23 / elision2.C
bloba698fc9f3abf98ae186320d2f298c2f45d87c48a
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.
5 struct Widget {
6     Widget();
7     Widget(Widget&&);
8 };
10 struct Frodo {
11     Frodo(Widget&);
12     Frodo(Widget&&) = delete;
15 struct Sam {
16     Sam(Widget&) = delete; // #1
17     Sam(const Widget&);  // #2
20 Sam twelve() {
21     Widget w;
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 } }
27 Frodo thirteen() {
28     Widget w;
29     // This is a correct error in both C++20 and C++23.
30     return w;  // { dg-error "use of deleted function" }
33 struct Merry {};
34 struct Pippin {};
35 struct Together : Merry, Pippin {};
36 struct Quest {
37     Quest(Merry&&);
38     Quest(Pippin&&);
39     Quest(Together&);
42 Quest fourteen() {
43   Together t;
44   // C++20: calls Quest(Together&).  Proposed: ill-formed.
45   return t; // { dg-error "ambiguous" "" { target c++23 } }