Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/move-return5.C

raw
1 // { dg-do compile { target c++11 } }
2 // This used to compile in C++11...17 because we performed two
3 // separate overload resolutions: one treating the operand as
4 // an rvalue, and then (if that resolution fails) another one
5 // treating the operand as an lvalue.
6
7 struct W {
8 W();
9 };
10
11 struct F {
12 F(W&);
13 F(W&&) = delete;
14 };
15
16 F fn ()
17 {
18 W w;
19 return w; // { dg-error "use of deleted function" }
20 }