Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/rv9p.C

raw
1 // PR c++/36744
2 // { dg-do run { target c++11 } }
3
4 struct S
5 {
6 S(): i(2) {}
7 S(S const&s): i(s.i) {}
8 int i;
9 };
10
11 void f(S x) { x.i = 0; }
12
13 extern "C" void abort (void);
14 int main()
15 {
16 S y;
17 f(static_cast<S&&>(y));
18 if (y.i != 2)
19 abort ();
20 return 0;
21 }