gcc/testsuite/g++.dg/cpp2a/constexpr-dtor15.C
raw| 1 | // PR c++/109357 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | // { dg-prune-output "used but never defined" } |
| 4 | |
| 5 | struct basic_string { |
| 6 | char _M_local_buf; |
| 7 | basic_string(); |
| 8 | constexpr basic_string(const char *) {} |
| 9 | constexpr ~basic_string(); |
| 10 | constexpr basic_string& operator=(basic_string); |
| 11 | }; |
| 12 | struct S1 { |
| 13 | basic_string x; |
| 14 | basic_string y; |
| 15 | } s1; |
| 16 | struct s2 { |
| 17 | ~s2(); |
| 18 | }; |
| 19 | s2::~s2() { s1 = {"", ""}; } |