Skip to content

Commit

Permalink
Merge pull request #68 from t3nsor/master
Browse files Browse the repository at this point in the history
D2686 updates from CWG Monday morning review in St. Louis
  • Loading branch information
cor3ntin authored Jun 24, 2024
2 parents a983446 + 4fcfa22 commit 4286052
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions src/D2686.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
\documentclass{wg21}

\title{\tcode{constexpr} structured bindings\\{\small and}\\\ references to \tcode{constexpr} variables}
\docnumber{P2686R3}
\docnumber{D2686R4}
\audience{EWG, CWG}
\author{Corentin Jabot}{[email protected]}
\authortwo{Brian Bi}{[email protected]}
Expand All @@ -23,6 +23,13 @@ \section{Abstract}

\section{Revisions}

\subsection{Revision 4}

The definitions of "constituent values" and "constituent references" have been
tweaked slightly with no change in meaning. The imprecise "at a point [...]
namespace scope" wording has been changed to refer to the nearest following
point at namespace scope.

\subsection{Revision 3}

CWG pointed out that the restrictions on volatile variables and mutable subobjects in the definition of ``usable in constant expressions'' have undesirable consequences. Those restrictions have therefore been moved to [basic.def.odr]. An unintentional omission in R2 has also been fixed: a local static constexpr reference shall not refer to a variable with automatic storage duration. Examples have also been added to the wording section.
Expand Down Expand Up @@ -526,11 +533,19 @@ \section{Wording for Option 3a (symbolic addressing with the same-function restr
\ednote{Insert a paragraph after p1:}

\begin{addedblock}
The \defn{constituent values} of an object $o$ are the value of $o$ if it has scalar type and the values of
any of $o$’s subobjects of scalar type, other than inactive union members and subobjects
thereof. The \defn{constituent references} of an object $o$ are the non-static data members of
reference type of $o$ and of any of $o$’s subobjects that are neither inactive union members nor
subobjects thereof.
The \defn{constituent values} of an object $o$ are:
\begin{itemize}
\item if $o$ has scalar type, the value of $o$;
\item otherwise, the constituent values of any direct subobjects of $o$, other
than inactive union members.
\end{itemize}

The \defn{constituent references} of an object $o$ are:
\begin{itemize}
\item any direct members of $o$ that have reference type, and
\item the constituent references of any direct subobjects of $o$ other than
inactive union members.
\end{itemize}
\end{addedblock}

\ednote{Insert a paragraph after p1:}
Expand Down Expand Up @@ -614,7 +629,7 @@ \section{Wording for Option 3a (symbolic addressing with the same-function restr
returns \keyword{true}.
\end{note}\added{, and}
\begin{addedblock}
\item immediately after the initializing declaration of \tcode{v}, the object or reference declared by \tcode{v} is constexpr-representable, and if \tcode{v} has static or thread storage duration, the object or reference declared by \tcode{v} is constexpr-representable at a point that follows the initializing declaration of \tcode{v} and whose immediate scope is a namespace scope.
\item immediately after the initializing declaration of \tcode{v}, the object or reference declared by \tcode{v} is constexpr-representable, and if \tcode{v} has static or thread storage duration, the object or reference declared by \tcode{v} is constexpr-representable at the nearest point following the initializing declaration of \tcode{v} whose immediate scope is a namespace scope.
\end{addedblock}
\end{itemize}
\begin{addedblock}
Expand Down Expand Up @@ -915,7 +930,7 @@ \section{Wording for Option 3a (symbolic addressing with the same-function restr
Immediately after the initializing declaration of \tcode{v},
$x$ shall be constexpr-representable.
If $x$ has static or thread storage duration, $x$ shall be
constexpr-representable at a point following the initializing declaration of
constexpr-representable at the nearest point following the initializing declaration of
\tcode{v} whose immediate scope is a namespace scope.
}

Expand Down

0 comments on commit 4286052

Please sign in to comment.