Debian Codegraph @

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

raw
1 // PR c++/119162
2 // { dg-do compile { target c++20 } }
3
4 constexpr int *
5 f7 ()
6 {
7 int *p = new int (2); // { dg-error "is not a constant expression because it refers to a result of" }
8 delete p;
9 return p;
10 }
11
12 void
13 g ()
14 {
15 constexpr auto v7 = f7 ();
16 }
17