Skip to content

Introduce term.* labels for [basic.types.general] terms #5104

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 10 commits into from
Feb 22, 2022
2 changes: 1 addition & 1 deletion source/atomics.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1918,7 +1918,7 @@
\begin{note}
For example, the effect of
\tcode{compare_exchange_strong}
on objects without padding bits\iref{basic.types} is
on objects without padding bits\iref{term.padding.bits} is
\begin{codeblock}
if (memcmp(this, &expected, sizeof(*this)) == 0)
memcpy(this, &desired, sizeof(*this));
Expand Down
20 changes: 15 additions & 5 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
\indextext{type!incomplete}%
In the definition of an object,
the type of that object shall not be
an incomplete type\iref{basic.types.general},
an incomplete type\iref{term.incomplete.type},
an abstract class type\iref{class.abstract}, or
a (possibly multi-dimensional) array thereof.

Expand Down Expand Up @@ -4595,6 +4595,7 @@
\indextext{object!byte copying and|)}

\pnum
\label{term.object.representation}%
The \defnx{object representation}{representation!object}
of an object of type \tcode{T} is the
sequence of \placeholder{N} \tcode{\keyword{unsigned} \keyword{char}} objects taken up
Expand All @@ -4603,6 +4604,7 @@
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 @@ -4625,8 +4627,9 @@
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
\defnx{incomplete types}{type!incomplete}\iref{basic.fundamental}.
\defnadjx{incomplete}{types}{type}\iref{basic.fundamental}.
\begin{note}
Objects cannot be defined to have an incomplete type\iref{basic.def}.
\end{note}
Expand Down Expand Up @@ -4681,27 +4684,33 @@
\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
\defnadjx{trivial}{types}{type}. Scalar types, standard-layout class
\defnadjx{trivial}{types}{type}.
\label{term.standard.layout.type}%
Scalar types, standard-layout class
types\iref{class.prop}, arrays of such types and
cv-qualified versions of these types
are collectively called \defnadjx{standard-layout}{types}{type}.
Expand All @@ -4710,6 +4719,7 @@
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 @@ -4741,9 +4751,9 @@
\end{note}

\pnum
\indextext{layout-compatible type}%
\label{term.layout.compatible.type}%
Two types \cvqual{cv1} \tcode{T1} and \cvqual{cv2} \tcode{T2} are
\defn{layout-compatible} types
\defnadjx{layout-compatible}{types}{type}
if \tcode{T1} and \tcode{T2} are the same type,
layout-compatible enumerations\iref{dcl.enum}, or
layout-compatible standard-layout class types\iref{class.mem}.
Expand Down
12 changes: 6 additions & 6 deletions source/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@

\pnum
A class is considered a completely-defined object
type\iref{basic.types} (or complete type) at the closing \tcode{\}} of
type\iref{term.incomplete.type} (or complete type) at the closing \tcode{\}} of
the \grammarterm{class-specifier}.
The class is regarded as complete within its complete-class contexts;
otherwise it is regarded as incomplete within its own class
Expand Down Expand Up @@ -689,7 +689,7 @@
\pnum
\indextext{class object!member}%
The type of a non-static data member shall not be an
incomplete type\iref{basic.types},
incomplete type\iref{term.incomplete.type},
an abstract class type\iref{class.abstract},
or a (possibly multi-dimensional) array thereof.
\begin{note}
Expand Down Expand Up @@ -812,7 +812,7 @@
Two standard-layout unions are layout-compatible if they
have the same number of non-static data members and corresponding
non-static data members (in any order) have layout-compatible
types\iref{basic.types}.
types\iref{term.layout.compatible.type}.

\pnum
In a standard-layout union with an active member\iref{class.union}
Expand Down Expand Up @@ -1659,7 +1659,7 @@

\pnum
The implicitly-defined copy/move constructor for a union
\tcode{X} copies the object representation\iref{basic.types} of \tcode{X}.
\tcode{X} copies the object representation\iref{term.object.representation} of \tcode{X}.
For each object nested within\iref{intro.object}
the object that is the source of the copy,
a corresponding object $o$ nested within the destination
Expand Down Expand Up @@ -1984,7 +1984,7 @@

\pnum
The implicitly-defined copy assignment operator for a
union \tcode{X} copies the object representation\iref{basic.types} of \tcode{X}.
union \tcode{X} copies the object representation\iref{term.object.representation} of \tcode{X}.
If the source and destination of the assignment are not the same object, then
for each object nested within\iref{intro.object}
the object that is the source of the copy,
Expand Down Expand Up @@ -2823,7 +2823,7 @@
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),
the extra bits are padding bits\iref{basic.types}.
the extra bits are padding bits\iref{term.padding.bits}.
\indextext{allocation!implementation-defined bit-field}%
Allocation of bit-fields within a class object is
\impldef{allocation of bit-fields within a class object}.
Expand Down
2 changes: 1 addition & 1 deletion source/concepts.tex
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@
\tcode{S} is an expression that exchanges the denoted values.
\tcode{S} is a constant expression if
\begin{itemize}
\item \tcode{T} is a literal type\iref{basic.types},
\item \tcode{T} is a literal type\iref{term.literal.type},
\item both \tcode{E1 = std::move(E2)} and \tcode{E2 = std::move(E1)} are
constant subexpressions\iref{defns.const.subexpr}, and
\item the full-expressions of the initializers in the declarations
Expand Down
3 changes: 2 additions & 1 deletion source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -14429,7 +14429,8 @@
\end{codeblock}

\pnum
\tcode{span<ElementType, Extent>} is a trivially copyable type\iref{basic.types.general}.
\tcode{span<ElementType, Extent>} is
a trivially copyable type\iref{term.trivially.copyable.type}.

\pnum
\tcode{ElementType} is required to be
Expand Down
6 changes: 3 additions & 3 deletions source/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4367,7 +4367,7 @@
\item
if
\tcode{T}
is a scalar type\iref{basic.types}, the
is a scalar type\iref{term.scalar.type}, the
object
is initialized to the value obtained by converting the integer literal \tcode{0}
(zero) to
Expand All @@ -4383,7 +4383,7 @@
if
\tcode{T}
is a (possibly cv-qualified) non-union class type,
its padding bits\iref{basic.types} are initialized to zero bits and
its padding bits\iref{term.padding.bits} are initialized to zero bits and
each non-static data member,
each non-virtual base class subobject, and,
if the object is not a base class subobject,
Expand All @@ -4394,7 +4394,7 @@
if
\tcode{T}
is a (possibly cv-qualified) union type,
its padding bits\iref{basic.types} are initialized to zero bits and
its padding bits\iref{term.padding.bits} are initialized to zero bits and
the
object's first non-static named
data member
Expand Down
10 changes: 5 additions & 5 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2863,7 +2863,7 @@

\pnum
A \grammarterm{type-requirement} that names a class template specialization
does not require that type to be complete\iref{basic.types}.
does not require that type to be complete\iref{term.incomplete.type}.

\rSec3[expr.prim.req.compound]{Compound requirements}
\indextext{requirement!compound}%
Expand Down Expand Up @@ -4826,7 +4826,7 @@
\end{note}
\begin{note}
See~\ref{intro.memory} for the definition of byte
and~\ref{basic.types} for the definition of object representation.
and~\ref{term.object.representation} for the definition of object representation.
\end{note}

\pnum
Expand Down Expand Up @@ -4952,9 +4952,9 @@
\grammarterm{type-id}\iref{dcl.name} or \grammarterm{new-type-id} to which
it is applied. The type of that object is the \defnadj{allocated}{type}.
\indextext{type!incomplete}%
This type shall be a complete object type, but not an abstract class
type or array
thereof~(\ref{intro.object}, \ref{basic.types}, \ref{class.abstract}).
This type shall be a complete object type\iref{term.incomplete.type},
but not an abstract class type\iref{class.abstract} or array
thereof\iref{intro.object}.
\begin{note}
Because references are not objects, references cannot be created by
\grammarterm{new-expression}{s}.
Expand Down
4 changes: 2 additions & 2 deletions source/lib-intro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1836,7 +1836,7 @@
{allocator.req.var}
\topline
\lhdr{Variable} & \rhdr{Definition} \\ \capsep
\tcode{T, U, C} & any \cv-unqualified object type\iref{basic.types} \\ \rowsep
\tcode{T, U, C} & any \cv-unqualified object type\iref{term.object.type} \\ \rowsep
\tcode{X} & an allocator class for type \tcode{T} \\ \rowsep
\tcode{Y} & the corresponding allocator class for type \tcode{U} \\ \rowsep
\tcode{XX} & the type \tcode{allocator_traits<X>} \\ \rowsep
Expand Down Expand Up @@ -2807,7 +2807,7 @@
\required
paragraph.
\item
If an incomplete type\iref{basic.types} is used as a template
If an incomplete type\iref{term.incomplete.type} is used as a template
argument when instantiating a template component or evaluating a concept, unless specifically
allowed for that component.
\end{itemize}
Expand Down
2 changes: 1 addition & 1 deletion source/numerics.tex
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
The specializations
\tcode{complex<float>},
\tcode{complex<double>}, and
\tcode{complex<long double>} are literal types\iref{basic.types}.
\tcode{complex<long double>} are literal types\iref{term.literal.type}.

\pnum
If the result of a function is not mathematically defined or not in
Expand Down
5 changes: 3 additions & 2 deletions source/strings.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

\pnum
This Clause describes components for manipulating sequences of
any non-array trivial standard-layout\iref{basic.types} type.
any non-array trivial standard-layout\iref{term.standard.layout.type} type.
Such types are called \defnx{char-like types}{char-like type},
and objects of
char-like types are called \defnx{char-like objects}{char-like object} or
Expand Down Expand Up @@ -4368,7 +4368,8 @@
unless otherwise specified.

\pnum
\tcode{basic_string_view<charT, traits>} is a trivially copyable type\iref{basic.types.general}.
\tcode{basic_string_view<charT, traits>} is
a trivially copyable type\iref{term.trivially.copyable.type}.

\rSec3[string.view.cons]{Construction and assignment}

Expand Down
4 changes: 2 additions & 2 deletions source/templates.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@
\end{codeblock}
\end{example}
\begin{note}
A template type argument can be an incomplete type\iref{basic.types}.
A template type argument can be an incomplete type\iref{term.incomplete.type}.
\end{note}

\rSec2[temp.arg.nontype]{Template non-type arguments}
Expand Down Expand Up @@ -5724,7 +5724,7 @@
If the template selected for the specialization\iref{temp.spec.partial.match}
has been declared, but not defined,
at the point of instantiation\iref{temp.point},
the instantiation yields an incomplete class type\iref{basic.types}.
the instantiation yields an incomplete class type\iref{term.incomplete.type}.
\begin{example}
\begin{codeblock}
template<class T> class X;
Expand Down
Loading