aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp23/elision3.C
blob: 246342e64d3e88f8279912cd7445a35af66499c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// PR c++/101165 - P2266R1 - Simpler implicit move
// { dg-do compile { target c++23 } }
// Test from P2266R1, $ 3.4. A specific case involving reference_wrapper.

#include <functional>

struct Widget {
    Widget();
    Widget(Widget&&);
};

std::reference_wrapper<Widget> fifteen() {
    Widget w;
    // OK until CWG1579; OK after LWG2993.  Proposed: ill-formed
    return w;  // { dg-error "could not convert" }
}