Skip to content

[macros] Introduce 'term.*' labels #5210

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion source/algorithms.tex
Original file line number Diff line number Diff line change
Expand Up @@ -10933,7 +10933,7 @@
\pnum
\constraints
The expression \tcode{::new (declval<void*>()) T(declval<Args>()...)}
is well-formed when treated as an unevaluated operand\iref{term.unevaluated.operand}.
is well-formed when treated as an \termref{unevaluated operand}.

\pnum
\effects
Expand Down
26 changes: 10 additions & 16 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@
\end{itemize}

\pnum
\label{term.odr.use}%
A variable is named by an expression
if the expression is an \grammarterm{id-expression} that denotes it.
A variable \tcode{x} whose name appears as a
Expand Down Expand Up @@ -870,8 +869,9 @@
\end{note}

\pnum
\indexdefnadj{corresponding}{object parameter}%
Two non-static member functions have
\defnadjx{corresponding}{object parameters}{object parameter} if:
\defnx{corresponding object parameters}{object parameter!corresponding!function} if:
\begin{itemize}
\item
exactly one is an implicit object member function
Expand All @@ -882,8 +882,9 @@
\item
their object parameters have the same type.
\end{itemize}
\indexdefnadj{corresponding}{object parameter}%
Two non-static member function templates have
\defnadjx{corresponding}{object parameters}{object parameter} if:
\defnx{corresponding object parameters}{object parameter!corresponding!function template} if:
\begin{itemize}
\item
exactly one is an implicit object member function
Expand Down Expand Up @@ -2818,7 +2819,7 @@
\indextext{linkage|)}

\pnum
A declaration $D$ \defnx{names}{name} an entity $E$ if
A declaration $D$ \defnx{names}{name (verb)} an entity $E$ if
\begin{itemize}
\item
$D$ contains a \grammarterm{lambda-expression} whose closure type is $E$,
Expand Down Expand Up @@ -2859,7 +2860,7 @@
\item
any reference to a non-volatile const object or reference
with internal or no linkage initialized with a constant expression
that is not an odr-use\iref{term.odr.use},
that is not an \termref{odr-use},
\end{itemize}
or defines a constexpr variable initialized to a TU-local value (defined below).
\begin{note}
Expand Down Expand Up @@ -4604,7 +4605,6 @@
The \defnx{value representation}{representation!value}
of an object of type \tcode{T} is the set of bits
that participate in representing a value of type \tcode{T}.
\label{term.padding.bits}%
Bits in the object representation that are not part of the value representation
are \defn{padding bits}.
For trivially copyable types, the value representation is
Expand All @@ -4627,7 +4627,6 @@
The size and layout of an instance of an incompletely-defined
object type is unknown.
\end{footnote}
\label{term.incomplete.type}%
Incompletely-defined object types and \cv{}~\keyword{void} are
\defnadjx{incomplete}{types}{type}\iref{basic.fundamental}.
\begin{note}
Expand Down Expand Up @@ -4684,27 +4683,23 @@
\end{note}

\pnum
\label{term.object.type}%
An \defn{object type} is a (possibly cv-qualified) type that is not
a function type, not a reference type, and not \cv{}~\keyword{void}.

\pnum
\indextext{class!trivial}%
\indextext{class!trivially copyable}%
\indextext{class!standard-layout}%
\label{term.scalar.type}%
Arithmetic types\iref{basic.fundamental}, enumeration types,
pointer types, pointer-to-member types\iref{basic.compound},
\tcode{std::nullptr_t},
and
cv-qualified\iref{basic.type.qualifier} versions of these
types are collectively called
\defnadjx{scalar}{types}{type}.
\label{term.trivially.copyable.type}%
Scalar types, trivially copyable class types\iref{class.prop},
arrays of such types, and cv-qualified versions of these
types are collectively called \defnadjx{trivially copyable}{types}{type}.
\label{term.trivial.type}%
Scalar types, trivial class types\iref{class.prop},
arrays of such types and cv-qualified versions of these
types are collectively called
Expand All @@ -4719,7 +4714,6 @@
are collectively called \defnadjx{implicit-lifetime}{types}{type}.

\pnum
\label{term.literal.type}%
A type is a \defnadj{literal}{type} if it is:
\begin{itemize}
\item \cv{}~\keyword{void}; or
Expand Down Expand Up @@ -4778,7 +4772,7 @@
\defnadjx{signed integer}{types}{type}.
The range of representable values for a signed integer type is
$-2^{N-1}$ to $2^{N-1}-1$ (inclusive),
where \placeholder{N} is called the \defn{width} of the type.
where \placeholder{N} is called the \defnx{width}{width!of integer type} of the type.
\indextext{integral type!implementation-defined \tcode{sizeof}}%
\begin{note}
Plain \tcode{int}s are intended to have
Expand Down Expand Up @@ -5078,7 +5072,7 @@
on the access to these entities\iref{class.access};

\item
\defnx{unions}{\idxcode{union}}, which are classes capable of containing objects of
\emph{unions}, which are classes capable of containing objects of
Comment on lines -5081 to +5075
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loses the index entry. Is that deliberate (since it's not really a definition)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Most of the stuff here is not really a definition and should be cleaned up eventually. The current stage just removes the one conflict that was flagged by LaTeX.

different types at different times, \ref{class.union};

\item
Expand Down Expand Up @@ -6559,7 +6553,7 @@
\pnum
\indextext{non-initialization odr-use|see{odr-use, non-initialization}}%
A \defnx{non-initialization odr-use}{odr-use!non-initialization}
is an odr-use\iref{term.odr.use} not caused directly or indirectly by
is an \termref{odr-use} not caused directly or indirectly by
the initialization of a non-block static or thread storage duration variable.

\pnum
Expand All @@ -6576,7 +6570,7 @@
A non-block variable with static storage duration
having initialization
with side effects is initialized in this case,
even if it is not itself odr-used\iref{term.odr.use,basic.stc.static}.
even if it is not itself odr-used\iref{term.odr-use,basic.stc.static}.
\end{footnote}
It is \impldef{threads and program points at which deferred dynamic initialization is performed}
in which threads and at which points in the program such deferred dynamic initialization occurs.
Expand Down
22 changes: 11 additions & 11 deletions source/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@
The implementation will implicitly declare these member functions for some class
types when the program does not explicitly declare them.
The implementation will implicitly define them
if they are odr-used\iref{term.odr.use} or
if they are \termrefx{odr-used}{odr-use} or
needed for constant evaluation\iref{expr.const}.
\end{note}
An implicitly-declared special member function is declared at the closing
Expand Down Expand Up @@ -1304,7 +1304,7 @@
that is defaulted and not defined as deleted
is
\defnx{implicitly defined}{constructor!implicitly defined}
when it is odr-used\iref{term.odr.use}
when it is \termrefx{odr-used}{odr-use}
to initialize an object of its class type\iref{intro.object},
when it is needed for constant evaluation\iref{expr.const}, or
when it is explicitly defaulted after its first declaration.
Expand Down Expand Up @@ -1605,12 +1605,12 @@
that is defaulted and not defined as deleted
is
\term{implicitly defined}
when it is odr-used\iref{term.odr.use},
when it is \termrefx{odr-used}{odr-use},
when it is needed for constant evaluation\iref{expr.const}, or
when it is explicitly defaulted after its first declaration.
\begin{note}
The copy/move constructor is implicitly defined even if the implementation elided
its odr-use\iref{term.odr.use,class.temporary}.
its odr-use\iref{term.odr-use,class.temporary}.
\end{note}
If the implicitly-defined constructor would satisfy the requirements of a
constexpr constructor\iref{dcl.constexpr}, the implicitly-defined
Expand Down Expand Up @@ -1908,7 +1908,7 @@
that is defaulted and not defined as deleted
is
\term{implicitly defined}
when it is odr-used\iref{term.odr.use}
when it is \termrefx{odr-used}{odr-use}
(e.g., when it is selected by overload resolution
to assign to an object of its class type),
when it is needed for constant evaluation\iref{expr.const}, or
Expand Down Expand Up @@ -2066,7 +2066,7 @@
The program is ill-formed if overload resolution fails.
Destructor selection does not constitute
a reference to,
or odr-use\iref{term.odr.use} of,
or \termref{odr-use} of,
the selected destructor,
and in particular,
the selected destructor may be deleted\iref{dcl.fct.def.delete}.
Expand Down Expand Up @@ -2141,7 +2141,7 @@
that is defaulted and not defined as deleted
is
\defnx{implicitly defined}{destructor!implicitly defined}
when it is odr-used\iref{term.odr.use}
when it is \termrefx{odr-used}{odr-use}
or when it is explicitly defaulted after its first declaration.

\pnum
Expand Down Expand Up @@ -2780,7 +2780,7 @@
\grammarterm{initializer-clause} that is an \grammarterm{assignment-expression}
is a constant expression\iref{expr.const}.
The member shall still be defined in a namespace scope if
it is odr-used\iref{term.odr.use} in the program and the
it is \termrefx{odr-used}{odr-use} in the program and the
namespace scope definition shall not contain an \grammarterm{initializer}.
The declaration of an inline static data member (which is a definition)
may specify a \grammarterm{brace-or-equal-initializer}. If the
Expand All @@ -2792,7 +2792,7 @@
\pnum
\begin{note}
There is exactly one definition of a static data member
that is odr-used\iref{term.odr.use} in a valid program.
that is \termrefx{odr-used}{odr-use} in a valid program.
\end{note}

\pnum
Expand All @@ -2819,7 +2819,7 @@
the bit-field semantic property is not part of the type of the class member.
The \grammarterm{constant-expression} shall be an integral constant expression
with a value greater than or equal to zero and
is called the \defn{width} of the bit-field.
is called the \defnx{width}{width!of bit-field} of the bit-field.
If the width of a bit-field is larger than
the width of the bit-field's type
(or, in case of an enumeration type, of its underlying type),
Expand Down Expand Up @@ -3381,7 +3381,7 @@
called a \defnadj{local}{class}.
\begin{note}
A declaration in a local class
cannot odr-use\iref{term.odr.use}
cannot \termref{odr-use}
a local entity
from an
enclosing scope.
Expand Down
13 changes: 6 additions & 7 deletions source/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1580,8 +1580,8 @@
\item otherwise, \tcode{decltype($E$)} is the type of $E$.
\end{itemize}

The operand of the \keyword{decltype} specifier is an unevaluated
operand\iref{term.unevaluated.operand}.
The operand of the \keyword{decltype} specifier is
an \termref{unevaluated operand}.

\begin{example}
\begin{codeblock}
Expand Down Expand Up @@ -3174,7 +3174,6 @@

\pnum
\indextext{declaration!array}%
\label{term.array.type}%
A type of the form ``array of \tcode{N} \tcode{U}'' or
``array of unknown bound of \tcode{U}'' is an \defn{array type}.
The optional \grammarterm{attribute-specifier-seq}
Expand Down Expand Up @@ -4125,7 +4124,7 @@

\pnum
\begin{note}
A local variable cannot be odr-used\iref{term.odr.use}
A local variable cannot be \termrefx{odr-used}{odr-use}
in a default argument.
\end{note}
\begin{example}
Expand Down Expand Up @@ -4172,7 +4171,7 @@
int f(int a, int b = a); // error: parameter \tcode{a} used as default argument
typedef int I;
int g(float I, int b = I(2)); // error: parameter \tcode{I} found
int h(int a, int b = sizeof(a)); // OK, unevaluated operand\iref{term.unevaluated.operand}
int h(int a, int b = sizeof(a)); // OK, \termref{unevaluated operand}
\end{codeblock}
\end{example}
A non-static member shall not appear in a default argument unless it appears as
Expand Down Expand Up @@ -6183,7 +6182,7 @@
Implementations are
permitted to provide additional predefined variables with names that are reserved to the
implementation\iref{lex.name}. If a predefined variable is not
odr-used\iref{term.odr.use}, its string value need not be present in the program image.
\termrefx{odr-used}{odr-use}, its string value need not be present in the program image.
\end{footnote}
\begin{example}
\begin{codeblock}
Expand Down Expand Up @@ -6342,7 +6341,7 @@
function. It applies even for references in expressions that are not
potentially-evaluated. For an overload set, only the
function selected by overload resolution is referenced. The implicit
odr-use\iref{term.odr.use} of a virtual function does not, by itself,
\termref{odr-use} of a virtual function does not, by itself,
constitute a reference.
\end{note}

Expand Down
2 changes: 1 addition & 1 deletion source/exceptions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@
\item in an expression, the function is selected by
overload resolution\iref{over.match,over.over};

\item the function is odr-used\iref{term.odr.use} or, if it appears in an
\item the function is \termrefx{odr-used}{odr-use} or, if it appears in an
unevaluated operand, would be odr-used if the expression were
potentially-evaluated;

Expand Down
Loading