gcc/testsuite/g++.dg/cpp0x/constexpr-nsdmi4.C
raw| 1 | // PR c++/114913 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | struct strt { |
| 5 | char *_M_dataplus; |
| 6 | char _M_local_buf = 0; |
| 7 | constexpr strt() |
| 8 | : _M_dataplus(&_M_local_buf) {} |
| 9 | constexpr strt(const strt &) |
| 10 | : _M_dataplus(&_M_local_buf) {} |
| 11 | }; |
| 12 | |
| 13 | constexpr strt |
| 14 | f () |
| 15 | { |
| 16 | return {}; |
| 17 | } |
| 18 | constexpr strt HelloWorld = f(); |
| 19 | const char *a() { return HelloWorld._M_dataplus; } |