aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2019-02-22 18:38:36 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2019-02-22 11:38:36 -0700
commit16a919a7162aa5dc92c0834ad4eef8b7f878a7ae (patch)
tree0d0c124dc1e6b0238b69ed522a53e7d765dfb438 /gcc/doc
parentc87cc0c01e374c992d4085990bb0f65fbaf33128 (diff)
downloadgcc-16a919a7162aa5dc92c0834ad4eef8b7f878a7ae.zip
gcc-16a919a7162aa5dc92c0834ad4eef8b7f878a7ae.tar.gz
gcc-16a919a7162aa5dc92c0834ad4eef8b7f878a7ae.tar.bz2
extend.texi (Other Builtins): Add __builtin_is_constant_evaluated.
gcc/ChangeLog: * doc/extend.texi (Other Builtins): Add __builtin_is_constant_evaluated. From-SVN: r269129
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/extend.texi17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 545d851..d9c78a3 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -12890,6 +12890,23 @@ built-in in this case, because it has no opportunity to perform
optimization.
@end deftypefn
+@deftypefn {Built-in Function} bool __builtin_is_constant_evaluated (void)
+The @code{__builtin_is_constant_evaluated} function is available only
+in C++. The built-in is intended to be used by implementations of
+the @code{std::is_constant_evaluated} C++ function. Programs should make
+use of the latter function rather than invoking the built-in directly.
+
+The main use case of the built-in is to determine whether a @code{constexpr}
+function is being called in a @code{constexpr} context. A call to
+the function evaluates to a core constant expression with the value
+@code{true} if and only if it occurs within the evaluation of an expression
+or conversion that is manifestly constant-evaluated as defined in the C++
+standard. Manifestly constant-evaluated contexts include constant-expressions,
+the conditions of @code{constexpr if} statements, constraint-expressions, and
+initializers of variables usable in constant expressions. For more details
+refer to the latest revision of the C++ standard.
+@end deftypefn
+
@deftypefn {Built-in Function} long __builtin_expect (long @var{exp}, long @var{c})
@opindex fprofile-arcs
You may use @code{__builtin_expect} to provide the compiler with