Debian Codegraph @

gcc/testsuite/g++.dg/cpp23/elision3.C

raw
1 // PR c++/101165 - P2266R1 - Simpler implicit move
2 // { dg-do compile { target c++23 } }
3 // Test from P2266R1, $ 3.4. A specific case involving reference_wrapper.
4
5 #include <functional>
6
7 struct Widget {
8 Widget();
9 Widget(Widget&&);
10 };
11
12 std::reference_wrapper<Widget> fifteen() {
13 Widget w;
14 // OK until CWG1579; OK after LWG2993. Proposed: ill-formed
15 return w; // { dg-error "could not convert" }
16 }