aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/consteval-prop20.C
blob: f1bb08e2dba7e8cc51d429410504672d3d805419 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// P2564R3
// { dg-do compile { target c++20 } }
// { dg-options "-Wno-c++23-extensions" }

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

constexpr int
f (auto i)
{
  return id (i);
}

void
g ()
{
  auto p = &f<int>; // { dg-error "taking address" }
  decltype(&f<int>) x;
  if consteval {
    auto q = &f<int>;
  }
}