blob: 72082f8d94942c0b07335a3bff96e5835c5900af (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
// P0595R2
// PR c++/88977
// { dg-do compile { target c++11 } }
namespace std {
constexpr inline bool
is_constant_evaluated () noexcept
{
return __builtin_is_constant_evaluated ();
}
}
template<bool B> constexpr bool foo () { return B; }
constexpr bool x = foo<std::is_constant_evaluated ()> ();
constexpr bool y = foo<__builtin_is_constant_evaluated ()> ();
static_assert (x, "");
static_assert (y, "");
|