gcc/testsuite/g++.dg/cpp0x/constexpr-nsdmi5.C
raw| 1 | // PR c++/110822 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | void __ostream_insert(const char*); |
| 5 | struct basic_string { |
| 6 | const char* _M_p; |
| 7 | char _M_local_buf[16] = {}; |
| 8 | constexpr basic_string() : _M_p(_M_local_buf) {} |
| 9 | const char *data() const { return _M_p; } |
| 10 | }; |
| 11 | constexpr basic_string f() { return {}; } |
| 12 | constexpr basic_string text = f(); |
| 13 | int main() { |
| 14 | __ostream_insert(text._M_p); |
| 15 | } |