aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/constexpr-delete2.C
blob: 999f9b7851ec9a8f46ff44209ee48091e146fa06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// PR c++/69203
// { dg-do compile { target c++11 } }

struct A { ~A(); };
constexpr int f(int i) { return i; }
constexpr int g(A* ap)
{
  return f((delete[] ap, 42)); // { dg-message "" "" { target c++17_down } }
}

A a;
constexpr int i = g(&a);	// { dg-error "" }
				// { dg-message "in 'constexpr' expansion of" "" { target c++2a } .-1 }