Skip to content

P0533R9 constexpr for <cmath> and <cstdlib> #5278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7393,7 +7393,11 @@
an \grammarterm{asm-declaration}\iref{dcl.asm};

\item
an invocation of the \tcode{va_arg} macro\iref{cstdarg.syn}; or
an invocation of the \tcode{va_arg} macro\iref{cstdarg.syn};

\item
a non-constant library call\iref{defns.nonconst.libcall};
or

\item
a \keyword{goto} statement\iref{stmt.goto}.
Expand Down
6 changes: 6 additions & 0 deletions source/intro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,12 @@
sequence of one or more bytes representing
the code unit sequence for an encoded character of the execution character set

\indexdefn{library call!non-constant}%
\definition{non-constant library call}{defns.nonconst.libcall}
invocation of a library function that,
as part of evaluating any expression \tcode{E},
prevents \tcode{E} from being a core constant expression

\definition{NTCTS}{defns.ntcts}
\defncontext{library}
\indexdefn{NTCTS}%
Expand Down
24 changes: 24 additions & 0 deletions source/lib-intro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,30 @@
ISO C \tcode{restrict} qualifier)
are the same unless otherwise stated.

\pnum
A call to a C standard library function is
a non-constant library call\iref{defns.nonconst.libcall}
if it raises a floating-point exception other than \tcode{FE_INEXACT}.
The semantics of a call to a C standard library function
evaluated as a core constant expression
are those specified in Annex F of the C standard
\begin{footnote}
See also ISO/IEC 9899:2018 section 7.6.
\end{footnote}
to the extent applicable to the floating-point types\iref{basic.fundamental}
that are parameter types of the called function.
\begin{note}
Annex F specifies
the conditions under which floating-point exceptions are raised and
the behavior when NaNs and/or infinities are passed as arguments.
\end{note}
\begin{note}
Equivalently, a call to a C standard library function is
a non-constant library call
if \tcode{errno} is set
when \tcode{math_errhandling \& MATH_ERRNO} is \tcode{true}.
\end{note}

\rSec1[description]{Method of description}

\rSec2[description.general]{General}
Expand Down
Loading