Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp2a/constexpr-new8.C @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 1830386684a0 |
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); |