Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9081288
CWG2609 Padding in class types
burblebee Apr 4, 2026
e3568c8
CWG2744 Multiple objects of the same type at the same address
burblebee Apr 4, 2026
eb45559
CWG2765 Address comparisons between potentially non-unique objects du…
burblebee Apr 4, 2026
c0a95fd
CWG2799 Inheriting default constructors
burblebee Apr 4, 2026
8b67856
CWG2947 Limiting macro expansion in pp-module
burblebee Apr 4, 2026
280c60d
CWG2966 Alignment and value representation of std::nullptr_t
burblebee Apr 4, 2026
351866d
CWG2976 Transferring control out of a function
burblebee Apr 4, 2026
273398d
CWG2983 Non-type template parameters are not variables
burblebee Apr 4, 2026
37be8a3
CWG2992 Labels do not have names
burblebee Apr 5, 2026
5caf7ef
CWG3010 constexpr placement-new should require transparent replaceabi…
burblebee Apr 5, 2026
d88021f
CWG3029 Confusing note about ordinary character types for aligned mem…
burblebee Apr 5, 2026
509f565
CWG3035 Lambda expressions in anonymous unions
burblebee Apr 5, 2026
c19df86
CWG3058 "Program point" is not defined
burblebee Apr 5, 2026
6e4aaee
CWG3125 Token convertibility requirement in #if
burblebee Apr 5, 2026
3b7c41e
CWG3126 A module import needs a header-name as a token
burblebee Apr 5, 2026
d27a004
CWG3128 Potentially-throwing unevaluated operands
burblebee Apr 5, 2026
cdaa725
CWG3129 Clarify which floating-point-literals are valid
burblebee Apr 5, 2026
ff55285
CWG3130 Naming function members of anonymous unions
burblebee Apr 5, 2026
57120fc
CWG3132 Unclear disambiguation rule for condition
burblebee Apr 5, 2026
7a53be5
CWG3133 Cv-qualified types in built-in operator candidates
burblebee Apr 5, 2026
094244c
CWG3136 Constant expressions of type void
burblebee Apr 5, 2026
c486843
CWG3142 Possible expansions of __LINE__ changing over time
burblebee Apr 6, 2026
35ed3ee
CWG3148 Definition of "user-declared" special member function
burblebee Apr 6, 2026
8359980
CWG3151 Closure types that are final
burblebee Apr 6, 2026
93bef83
CWG3153 Immediate-escalating defaulted comparison
burblebee Apr 6, 2026
ce4ef37
CWG3155 Escalation of virtual functions
burblebee Apr 6, 2026
d112df8
CWG3156 Handling of deleted functions in unevaluated lambda-captures
burblebee Apr 6, 2026
750418c
CWG3157 Missing handling of operator new[] for deallocation function …
burblebee Apr 6, 2026
72efcd9
CWG3171 Codify the strong ownership for modules
burblebee Apr 6, 2026
c9a5354
CWG3173 Remove misleading footnote about as-if rule
burblebee Apr 6, 2026
18db167
FIXUP CWG2609: Fix index and location of definition "property of the …
burblebee Apr 7, 2026
3a5222d
FIXUP CWG2744: Add missing comma
burblebee Apr 7, 2026
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
100 changes: 75 additions & 25 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,26 @@
\end{note}

\pnum
A \defn{name} is an \grammarterm{identifier}\iref{lex.name},
\grammarterm{conversion-function-id}\iref{class.conv.fct},
\grammarterm{operator-function-id}\iref{over.oper}, or
\grammarterm{literal-operator-id}\iref{over.literal}.
A \defn{name} is
\begin{itemize}
\item an \grammarterm{identifier} token\iref{lex.token, lex.name} other than
\begin{itemize}
\item
the \grammarterm{identifier} of a
\grammarterm{label}\iref{stmt.label} or
\grammarterm{literal-operator-id}\iref{over.literal},
\item
the \grammarterm{identifier} following a goto in a
\grammarterm{jump-statement}\iref{stmt.jump.general},
\item
any \grammarterm{identifier} in a
\grammarterm{module-name}\iref{module.unit} or
\grammarterm{attribute-token}\iref{dcl.attr.grammar}, or
\end{itemize}
\item a \grammarterm{conversion-function-id}\iref{class.conv.fct},
\item an \grammarterm{operator-function-id}\iref{over.oper}, or
\item a \grammarterm{literal-operator-id}\iref{over.literal}.
\end{itemize}

\pnum
Two names are \defnx{the same}{name!same} if
Expand Down Expand Up @@ -115,13 +131,15 @@

\pnum
A \defn{variable} is introduced by the
declaration of
declaration $D$ of
\begin{itemize}
\item
a reference other than a non-static data member or
\item
an object.
an object,
\end{itemize}
where $D$ is not the \grammarterm{parameter-declaration} of
a \grammarterm{template-parameter}.

\pnum
An \defn{entity} is a
Expand Down Expand Up @@ -1660,6 +1678,11 @@
used in further processing.

\pnum
There is a \defnadj{program}{point}
before the first token of the translation unit,
at least one between every pair of adjacent tokens, and
at least one after the last token of the translation unit.

A program point $P$ is said to follow
any declaration in the same translation unit
whose locus\iref{basic.scope.pdecl} is before $P$.
Expand Down Expand Up @@ -3056,9 +3079,7 @@
\item
they both declare type aliases or namespace aliases that have the same underlying entity, or
\item
they both declare names with module linkage and are attached to the same module, or
\item
they both declare names with external linkage.
they both declare names with module or external linkage and are attached to the same module.
\end{itemize}
\begin{note}
There are other circumstances in which declarations declare
Expand All @@ -3075,9 +3096,11 @@
\end{note}

\pnum
If two declarations of an entity are
attached to different modules, the program is ill-formed;
no diagnostic is required if neither is reachable from the other.
\begin{note}
If two declarations correspond but are
attached to different modules, the program is ill-formed
if one precedes the other\iref{basic.scope.scope}.
\end{note}
\begin{example}
\begin{codeblocktu}{\tcode{"decls.h"}}
int f(); // \#1, attached to the global module
Expand All @@ -3089,15 +3112,15 @@
#include "decls.h"
export module M;
export using ::f; // OK, does not declare an entity, exports \#1
int g(); // error: matches \#2, but attached to \tcode{M}
int g(); // error: corresponds to \#2, but attached to \tcode{M}
export int h(); // \#3
export int k(); // \#4
\end{codeblocktu}

\begin{codeblocktu}{Other translation unit}
import M;
static int h(); // error: matches \#3
int k(); // error: matches \#4
static int h(); // error: corresponds to \#3
int k(); // error: corresponds to \#4
\end{codeblocktu}
\end{example}
As a consequence of these rules,
Expand Down Expand Up @@ -3640,18 +3663,18 @@
may have the same address if
\begin{itemize}
\item one is nested within the other,
\item at least one is a subobject of zero size and they are not of similar types\iref{conv.qual},
\item
they are both nested within some complete object $o$,
exactly one is a subobject of $o$, and the subobject is of zero size,
\item
they are both subobjects of the same complete object,
at least one is a subobject of zero size, and
they are not of similar types\iref{conv.qual},
or
\item they are both potentially non-unique objects;
\end{itemize}
otherwise, they have distinct addresses
and occupy disjoint bytes of storage.
\begin{footnote}
Under the ``as-if'' rule an
implementation is allowed to store two objects at the same machine address or
not store an object at all if the program cannot observe the
difference\iref{intro.execution}.
\end{footnote}
\begin{example}
\begin{codeblock}
static const char test1 = 'x';
Expand Down Expand Up @@ -3827,8 +3850,8 @@
the narrow character types\iref{basic.fundamental} shall have the weakest
alignment requirement.
\begin{note}
This enables the ordinary character types to be used as the
underlying type for an aligned memory area\iref{dcl.align}.
The type \tcode{\keyword{unsigned} \keyword{char}} can be used as
the element type of an array providing aligned storage\iref{dcl.align}.
\end{note}

\pnum
Expand Down Expand Up @@ -5660,7 +5683,12 @@
A prvalue of type \tcode{std::nullptr_t} is a null pointer
constant\iref{conv.ptr}. Such values participate in the pointer and the
pointer-to-member conversions\iref{conv.ptr,conv.mem}.
\tcode{\keyword{sizeof}(std::nullptr_t)} shall be equal to \tcode{\keyword{sizeof}(\keyword{void}*)}.
The size\iref{expr.sizeof} and alignment requirement\iref{basic.align} of
the type \tcode{std::nullptr_t} are those of
the type ``pointer to \keyword{void}''.
\begin{note}
The value representation can comprise no bits\iref{conv.lval}.
\end{note}

\pnum
A value of type \tcode{std::meta::info} is called a \defn{reflection}.
Expand Down Expand Up @@ -5979,6 +6007,28 @@
alignment requirement.
\end{note}

\pnum
A pointer value
pointing to a potentially non-unique object $O$\iref{intro.object} is
\indextext{value!associated with an evaluation}%
\defn{associated with} the evaluation of
\begin{itemize}
\item
the string-literal\iref{lex.string} that resulted in the string literal object,
\item
the initializer list\iref{dcl.init.list} that resulted in the backing array,
or
\item
the initialization of
the template parameter object\iref{temp.arg.nontype, meta.define.static}
\end{itemize}
that is $O$ or of which $O$ is a subobject.
\begin{note}
A pointer value obtained by pointer arithmetic\iref{expr.add}
from a pointer value associated with an evaluation $E$
is also associated with $E$.
\end{note}

\pnum
A pointer value $P$ is
\indextext{value!valid in the context of an evaluation}%
Expand Down
57 changes: 43 additions & 14 deletions source/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,9 @@
shall either
declare at least one member name of the class
or declare at least one unnamed bit-field.
A user-declared entity is
a direct member or a friend that, in either case,
is declared by a \grammarterm{member-declaration}.

\pnum
A \defn{data member} is either a non-function member introduced by a
Expand Down Expand Up @@ -1273,10 +1276,12 @@
has a default argument
(including the case of a constructor with no parameters).
\indextext{implicitly-declared default constructor}%
If there is no user-declared constructor or constructor template for class
\tcode{X},
If a class does not have
a user-declared constructor or constructor template,
and \tcode{X} is not an anonymous union,
a non-explicit constructor having no parameters is implicitly declared
as defaulted\iref{dcl.fct.def}.

An implicitly-declared default constructor is an
inline public member of its class.

Expand Down Expand Up @@ -1503,7 +1508,8 @@
\end{example}

\pnum
If the class definition does not explicitly declare a copy constructor,
If the class does not have a user-declared copy constructor
and the class is not an anonymous union,
a non-explicit one is declared \defnx{implicitly}{constructor!copy!implicitly declared}.
If the class definition declares a move
constructor or move assignment operator, the implicitly declared copy
Expand Down Expand Up @@ -1543,10 +1549,13 @@

\pnum
\indextext{constructor!move!implicitly declared}%
If the definition of a class \tcode{X} does not explicitly declare
a move constructor, a non-explicit one will be
If a class \tcode{X} does not have
a user-declared move constructor, a non-explicit one will be
implicitly declared as defaulted if and only if
\begin{itemize}
\item
\tcode{X} is not an anonymous union,

\item
\tcode{X} does not have a user-declared copy constructor,

Expand Down Expand Up @@ -1601,6 +1610,17 @@
an rvalue which can use the copy constructor instead.
\end{note}

\pnum
\begin{note}
A using-declaration in a derived class \tcode{C} that
names a constructor from a base class
never suppresses the implicit declaration of
a copy/move constructor of \tcode{C},
even if the base class constructor would be
a copy or move constructor
if declared as a member of \tcode{C}.
\end{note}

\pnum
\indextext{constructor!copy!trivial}%
\indextext{constructor!move!trivial}%
Expand Down Expand Up @@ -1742,9 +1762,10 @@
\end{note}

\pnum
If the class definition does not explicitly declare a copy assignment operator,
If the class does not have a user-declared copy assignment operator
and the class is not an anonymous union,
one is declared \defnx{implicitly}{assignment operator!copy!implicitly declared}.
If the class definition declares a move
If the class has a user-declared move
constructor or move assignment operator, the implicitly declared copy
assignment operator is defined as deleted; otherwise, it is
defaulted\iref{dcl.fct.def}.
Expand Down Expand Up @@ -1796,6 +1817,9 @@
move assignment operator, one
will be implicitly declared as defaulted if and only if
\begin{itemize}
\item
\tcode{X} is not an anonymous union,

\item
\tcode{X} does not have a user-declared copy constructor,

Expand Down Expand Up @@ -2030,7 +2054,8 @@
\indextext{generated destructor|see{destructor, default}}%
\indextext{destructor!default}%
If a class has no user-declared
prospective destructor,
prospective destructor
and the class is not an anonymous union,
a prospective destructor is implicitly
declared as defaulted\iref{dcl.fct.def}.
An implicitly-declared prospective destructor is an
Expand All @@ -2043,7 +2068,8 @@
\end{codeblock}

\pnum
At the end of the definition of a class,
At the end of the definition of a class
other than an anonymous union,
overload resolution is performed
among the prospective destructors declared in that class
with an empty argument list
Expand Down Expand Up @@ -3266,13 +3292,16 @@
an \defnx{anonymous union member}{member!anonymous union}
if it is a non-static data member or
an \defnx{anonymous union variable}{variable!anonymous union} otherwise.
Each object of such an unnamed type shall be such an unnamed object.
\indextext{access control!anonymous \tcode{union}}%
\indextext{restriction!anonymous \tcode{union}}%
Each \grammarterm{member-declaration} in the \grammarterm{member-specification}
of an anonymous union shall define one or more public non-static data members,
be an \grammarterm{empty-declaration}, or
be a \grammarterm{static_assert-declaration}.
Nested types, anonymous unions, and functions
Nested types
(including closure types\iref{expr.prim.lambda.closure} and anonymous unions)
and functions
shall not be declared within an anonymous union.
The names of the members of an anonymous union
are bound in the scope inhabited by the union declaration.
Expand Down Expand Up @@ -4099,11 +4128,11 @@
\indextext{function!virtual|)}

\pnum
A class with a \keyword{consteval} virtual function that overrides
a virtual function that is not \keyword{consteval}
A class with an immediate virtual function that overrides
a non-immediate virtual function
shall have consteval-only type\iref{basic.types.general}.
A \keyword{consteval} virtual function shall not be overridden by
a virtual function that is not \keyword{consteval}.
An immediate virtual function shall not be overridden by
a non-immediate virtual function.

\rSec2[class.abstract]{Abstract classes}%

Expand Down
16 changes: 8 additions & 8 deletions source/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8803,14 +8803,14 @@
\grammarterm{using-declaration} cannot refer to a
destructor for a base class.
\end{note}
If a constructor or assignment operator brought from a base class into a derived class
has the signature of a copy/move constructor or assignment operator
for the derived class\iref{class.copy.ctor,class.copy.assign},
the \grammarterm{using-declaration} does not by itself
suppress the implicit declaration of the derived class member;
the member from the base class is hidden or overridden
by the implicitly-declared copy/move constructor or assignment operator
of the derived class, as described below.
\begin{note}
A \grammarterm{using-declarator} that
names a member function of a base class
does not suppress the implicit declaration of a special member function
in the derived class,
even if their signatures are the
same\iref{class.default.ctor, class.copy.ctor, class.copy.assign}.
\end{note}

\pnum
A \grammarterm{using-declaration} shall not name a \grammarterm{template-id}.
Expand Down
2 changes: 1 addition & 1 deletion source/exceptions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@
or
\item
any of the immediate subexpressions\iref{intro.execution}
of $E$ is potentially-throwing.
of $E$ that is not an unevaluated operand is potentially-throwing.
\end{itemize}

\pnum
Expand Down
Loading
Loading