gcc/testsuite/g++.dg/cpp0x/constexpr-empty9.C
raw| 1 | // PR c++/65896 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | struct base {}; |
| 5 | |
| 6 | struct derived : base { |
| 7 | constexpr derived(): |
| 8 | base{}, |
| 9 | m_value(0) { |
| 10 | } |
| 11 | int m_value; |
| 12 | }; |
| 13 | |
| 14 | constexpr int by_ref(derived && value) { |
| 15 | return value.m_value; |
| 16 | } |
| 17 | |
| 18 | constexpr int value = by_ref(derived{}); |