blob: 809e3d2e687c1aee35f53207c87278630909adb2 [file] [log] [blame]
// P0595R2
// { dg-do compile { target c++14 } }
namespace std {
constexpr inline bool
is_constant_evaluated () noexcept
{
return __builtin_is_constant_evaluated ();
}
}
constexpr int
foo () noexcept
{
return std::is_constant_evaluated () ? 5 : 12;
}
static_assert (std::is_constant_evaluated (), "");
static_assert (foo () == 5, "");