From 5b7f02010b9efda8bfd0baf3e5df12c7674c088c Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 19 Jun 2026 00:38:12 -0700 Subject: [PATCH] P3822R2 Conditional noexcept specifiers in compound requirements --- source/exceptions.tex | 8 +++++--- source/expressions.tex | 13 ++++++++++--- source/preprocessor.tex | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/source/exceptions.tex b/source/exceptions.tex index df3b639dc0..bb3b43101e 100644 --- a/source/exceptions.tex +++ b/source/exceptions.tex @@ -781,9 +781,7 @@ \indextext{exception specification!noexcept!constant expression and}% In a \grammarterm{noexcept-specifier}, the \grammarterm{constant-expression}, if supplied, shall be a contextually converted constant expression -of type \keyword{bool}\iref{expr.const.const}; -that constant expression is the exception specification of -the function type in which the \grammarterm{noexcept-specifier} appears. +of type \keyword{bool}\iref{expr.const.const}. A \tcode{(} token that follows \keyword{noexcept} is part of the \grammarterm{noexcept-specifier} and does not commence an initializer\iref{dcl.init}. @@ -799,6 +797,10 @@ \end{codeblock} \end{example} +\pnum +If the \grammarterm{noexcept-specifier} appears in a function type, +the \grammarterm{constant-expression} is the type's exception specification. + \pnum If a declaration of a function does not have a \grammarterm{noexcept-specifier}, diff --git a/source/expressions.tex b/source/expressions.tex index 72f77d87bb..3db02a4cd2 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -3407,7 +3407,7 @@ \begin{bnf} \nontermdef{compound-requirement}\br - \terminal{\{} expression \terminal{\}} \opt{\keyword{noexcept}} \opt{return-type-requirement} \terminal{;} + \terminal{\{} expression \terminal{\}} \opt{noexcept-specifier} \opt{return-type-requirement} \terminal{;} \end{bnf} \begin{bnf} @@ -3429,8 +3429,15 @@ into the \grammarterm{expression} is performed. \item -If the \keyword{noexcept} specifier is present, -$E$ shall not be a potentially-throwing expression\iref{except.spec}. +If the \grammarterm{noexcept-specifier}\iref{except.spec} is present, then: +\begin{itemize} +\item +Substitution of template arguments (if any) +into its associated \grammarterm{constant-expression} is performed. +\item +If the value of the converted \grammarterm{constant-expression} is \tcode{true}, +$E$ shall not be a potentially-throwing expression. +\end{itemize} \item If the \grammarterm{return-type-requirement} is present, then: diff --git a/source/preprocessor.tex b/source/preprocessor.tex index 0bfb7f194f..f4acab26ed 100644 --- a/source/preprocessor.tex +++ b/source/preprocessor.tex @@ -2383,7 +2383,7 @@ \defnxname{cpp_binary_literals} & \tcode{201304L} \\ \rowsep \defnxname{cpp_capture_star_this} & \tcode{201603L} \\ \rowsep \defnxname{cpp_char8_t} & \tcode{202207L} \\ \rowsep -\defnxname{cpp_concepts} & \tcode{202002L} \\ \rowsep +\defnxname{cpp_concepts} & \tcode{202606L} \\ \rowsep \defnxname{cpp_conditional_explicit} & \tcode{201806L} \\ \rowsep \defnxname{cpp_consteval} & \tcode{202211L} \\ \rowsep \defnxname{cpp_constexpr} & \tcode{202406L} \\ \rowsep