Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated7.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 // P0595R2 | |
2 // PR c++/88977 | |
3 // { dg-do compile { target c++11 } } | |
4 | |
5 namespace std { | |
6 constexpr inline bool | |
7 is_constant_evaluated () noexcept | |
8 { | |
9 return __builtin_is_constant_evaluated (); | |
10 } | |
11 } | |
12 | |
13 template<bool B> constexpr bool foo () { return B; } | |
14 | |
15 constexpr bool x = foo<std::is_constant_evaluated ()> (); | |
16 constexpr bool y = foo<__builtin_is_constant_evaluated ()> (); | |
17 static_assert (x, ""); | |
18 static_assert (y, ""); |