Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/constexpr-dtor12.C

raw
1 // PR c++/104513
2 // { dg-do compile { target c++20 } }
3
4 struct S {
5 constexpr S () : s (nullptr) {}
6 constexpr ~S () { delete s; }
7 int *s;
8 };
9 struct T : S {
10 constexpr T () : S () {}
11 constexpr ~T () { s = new int (42); return; }
12 };
13 constexpr T t;