aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/consteval-defarg1.C
blob: 826ee254c206fe7b218f773418f70985554e9182 (plain)
1
2
3
4
5
6
7
8
9
10
11
// Test that late-parsed default args have the same consteval semantics.
// { dg-do compile { target c++20 } }

consteval bool foo (bool x) { if (x) throw 1; return false; }
consteval bool bar (bool x = foo (true)) { return true; }
struct S
{
  consteval static bool baz (bool x = foo (true)) { return true; }
};
constexpr bool a = bar (true);
constexpr bool b = S::baz (true);