aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/consteval-defarg3.C
blob: 316219c65479532ea08d3b6d8666fac662c6e0ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// DR 2631: default args and DMI aren't immediately evaluated
// { dg-do compile { target c++20 } }
// { dg-final { scan-assembler-not "foober" } }

consteval int foober();

int g(int = foober());
struct A { int i = foober(); };
template <int i = foober()> struct B { };
struct C
{
  consteval C(int = foober()) { }
};
int h(C = C());

consteval int foober() { return 42; }

int main() {
  A a;
  B<> b;
  g();
  h();
}