aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/constexpr-new26.C
blob: c82bd43205f45d157c3794ff99b96f0f75e49a68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// PR c++/119162
// { dg-do compile { target c++20 } }

constexpr int *
f7 ()
{
  int *p = new int (2);	// { dg-error "is not a constant expression because it refers to a result of" }
  delete p;
  return p;
}

void
g ()
{
  constexpr auto v7 = f7 ();
}