gcc/testsuite/g++.dg/cpp0x/constexpr-prvalue1.C
raw| 1 | // PR c++/116416 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | // { dg-options "-O" } |
| 4 | |
| 5 | struct optional { |
| 6 | constexpr optional(int) {} |
| 7 | }; |
| 8 | optional foo() { return 2; } |
| 9 | |
| 10 | |
| 11 | struct C { |
| 12 | constexpr C(int) {} |
| 13 | }; |
| 14 | |
| 15 | struct B { |
| 16 | C fn(int) { return 0; } |
| 17 | }; |
| 18 | |
| 19 | void |
| 20 | g () |
| 21 | { |
| 22 | B b; |
| 23 | b.fn(0); |
| 24 | } |