Skip to content

Commit 5c6f3db

Browse files
Update definition of NoexceptSpecification (#173)
The field `words` of structure `NoexcepSpecification` is now renamed to `expr` and its type is changed to `ExprIndex`, which is more general to represent both usual elaborated expressions and unparsed sequence of tokens.
1 parent 1d0a664 commit 5c6f3db

File tree

1 file changed

+46
-37
lines changed

1 file changed

+46
-37
lines changed

ltx/decls.tex

Lines changed: 46 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,52 @@ \subsection{Parameter Position}
172172

173173
A parameter at a given level can be identified by its position in its enclosing parameter list. The position of a template parameter is given by a value of type \type{ParameterPosition}, defined as \newtype{ParameterPosition}{32}
174174

175+
\subsection{Exception Specification}
176+
\label{sec:ifc:exception-specification}
177+
178+
The semantics of a \grammar{noexcept-specifier} are currently
179+
captured by the type \type{NoexceptSpecification} with the following
180+
structural layout
181+
%
182+
\begin{figure}[H]
183+
\centering
184+
\structure[text width = 15em]{
185+
\DeclareMember{expr}{ExprIndex} \\
186+
\DeclareMember{sort}{NoexceptSort} \\
187+
}
188+
\caption{Structure of a \code{noexcept}-specification}
189+
\label{fig:ifc-noexcept-specification-structure}
190+
\end{figure}
191+
%
192+
The \field{expr} field, when not null, denotes the operand to the \code{noexcept} operator
193+
used in a \grammar{noexcept-specifier} if present in the declaration of a function.
194+
This field is meaningful only for templated functions for which the \grammar{noexcept-specifier} is a dependent expression.
195+
The \field{sort} field describes the computed semantics, if not dependent.
196+
It has type
197+
\begin{typedef}{NoexceptSort}{}
198+
enum class NoexceptSort : uint8_t {
199+
None,
200+
False,
201+
True,
202+
Expression,
203+
Inferred,
204+
Unenforced,
205+
};
206+
\end{typedef}
207+
with the following meaning
208+
\begin{itemize}
209+
\item \valueTag{NoexceptSort::None}: No specification is lexically present in the input source
210+
\item \valueTag{NoexceptSort::False}: The syntax \code{noexcept(false)} was explicitly used, or the determination has similar semantic effect
211+
\item \valueTag{NoexceptSort::True}: The syntax \code{noexcept(true)} was explicitly used, or the determination has similar semantic effect.
212+
\item \valueTag{NoexceptSort::Expression}: The syntax \code{noexcept(expr)} was explicitly used, and no determination could be made because the expression is dependent.
213+
\item \valueTag{NoexceptSort::Inferred}: The \code{noexcept} specification (for a special member) is inferred and dependent on that of the associated functions
214+
the special member invokes from base class subobjects or non-static data members.
215+
\item \valueTag{NoexceptSort::Unenforced}: This is the specification for the static type system, but with no runtime termination enforcement
216+
\end{itemize}
217+
218+
\note{In version 0.43 and prior of the IFC, the \field{expr} field of a
219+
\type{NoexceptSpecification} structure was previously named \field{words} and was of type \type{SentenceIndex}}
220+
175221
\section{Declaration structures}
176222
\label{sec:ifc:decl-structures}
177223

@@ -1016,43 +1062,6 @@ \subsection{\valueTag{DeclSort::Constructor}}
10161062

10171063
\note{The \field{name} field is subject of further design modification}
10181064

1019-
The structure \type{NoexceptSpecification} has the following layout
1020-
%
1021-
\begin{figure}[H]
1022-
\centering
1023-
\structure[text width = 15em]{
1024-
\DeclareMember{words}{SentenceIndex} \\
1025-
\DeclareMember{sort}{NoexceptSort} \\
1026-
}
1027-
\caption{Structure of a \code{noexcept}-specification}
1028-
\label{fig:ifc-noexcept-specification-structure}
1029-
\end{figure}
1030-
%
1031-
The \field{words} field denotes the sentence making up the syntax of the noexcept-specification.
1032-
This field is meaningful only for templated functions for which the noexcept-specification is a dependent expression.
1033-
The \field{sort} field describes the computed semantics, if not dependent.
1034-
It has type
1035-
\begin{typedef}{NoexceptSort}{}
1036-
enum class NoexceptSort : uint8_t {
1037-
None,
1038-
False,
1039-
True,
1040-
Expression,
1041-
Inferred,
1042-
Unenforced,
1043-
};
1044-
\end{typedef}
1045-
with the following meaning
1046-
\begin{itemize}
1047-
\item \valueTag{NoexceptSort::None}: No specification is lexically present in the input source
1048-
\item \valueTag{NoexceptSort::False}: The syntax \code{noexcept(false)} was explicitly used, or the determination has similar semantic effect
1049-
\item \valueTag{NoexceptSort::True}: The syntax \code{noexcept(true)} was explicitly used, or the determination has similar semantic effect.
1050-
\item \valueTag{NoexceptSort::Expression}: The syntax \code{noexcept(expr)} was explicitly used, and no determination could be made because the expression is dependent.
1051-
\item \valueTag{NoexceptSort::Inferred}: The \code{noexcept} specification (for a special member) is inferred and dependent on that of the associated functions
1052-
the special member invokes from base class subobjects or non-static data members.
1053-
\item \valueTag{NoexceptSort::Unenforced}: This is the specification for the static type system, but with no runtime termination enforcement
1054-
\end{itemize}
1055-
10561065
\subsection{\valueTag{DeclSort::InheritedConstructor}}
10571066
\label{sec:ifc:DeclSort:InheritedConstructor}
10581067

0 commit comments

Comments
 (0)