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

constexpr int *
f7 ()
{
  int *p = new int (2);		// { dg-message "allocated here" }
  delete p;
  return p;
}

void
g ()
{
  constexpr auto v7 = f7 (); // { dg-error "is not a constant expression because it refers to a result of" }
}