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

consteval int foo () { return 42; }

consteval int
bar (int (*fn) ())
{
  return fn ();
}

void
baz ()
{
  static_assert (bar (({ constexpr auto a = 1; foo; })) == 42);
}