Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp2a/constexpr-new8.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
rev | line source |
---|---|
145 | 1 // PR c++/91369 |
2 // { dg-do compile { target c++2a } } | |
3 // { dg-additional-options "-fdelete-null-pointer-checks" } | |
4 | |
5 struct A { | |
6 constexpr A () : p{new int} {} | |
7 constexpr ~A () { delete p; } | |
8 int *p; | |
9 }; | |
10 | |
11 constexpr bool | |
12 test () | |
13 { | |
14 A{}; | |
15 return true; | |
16 } | |
17 | |
18 constexpr auto res = test (); | |
19 static_assert (res); |