Debian Codegraph @

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

raw
1 // PR c++/91212
2 // Test that C++11 implicit move semantics don't call the const copy.
3 // In C++23, we call #2.
4 // { dg-do link { target c++20_down } }
5
6 struct T { int i; };
7
8 struct X {
9 X(T&) { } // #1
10 X(const T&); // #2
11 };
12
13 X
14 fn ()
15 {
16 T buf;
17 return buf;
18 }
19
20 int
21 main()
22 {
23 X c = fn ();
24 }