aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/consteval-prop17.C
blob: 47ec9b60b6cd6be073d729774f58bb8473d25b26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// P2564R3
// { dg-do compile { target c++20 } }
// { dg-options "-fno-immediate-escalation" }

consteval int id(int i) { return i; }

constexpr int
f (auto i)
{
  return id (i); // { dg-error "not a constant expression" }
}

int
g ()
{
  return f (42);
}