Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
22546a3
CWG1621 Member initializers in anonymous unions
Nov 12, 2019
d14f1de
CWG2126 Lifetime-extended temporaries in constant expressions
Nov 12, 2019
f650aef
CWG2282 Consistency with mismatched aligned/non-over-aligned allocati…
Nov 12, 2019
00e8011
CWG2347 Passing short scoped enumerations to ellipsis
Nov 13, 2019
3daaf90
CWG2374 Overly permissive specification of enum direct-list-initializ…
Nov 13, 2019
9700b13
CWG2399 Unclear referent of “expression” in assignment-expression
Nov 13, 2019
ec29589
CWG2419 Loss of generality treating pointers to objects as one-elemen…
Nov 13, 2019
7e730f8
[basic.compound] [numeric.ops.midpoint] Unify terminology used to
zygoloid Nov 19, 2019
7c9d35d
CWG2422 Incorrect grammar for deduction-guide
Nov 13, 2019
501a10b
CWG2424 constexpr initialization requirements for variant members
Nov 13, 2019
b5fd3b9
CWG2426 Reference to destructor that cannot be invoked
Nov 13, 2019
2c7090e
CWG2427 Deprecation of volatile operands and unevaluated contexts
Nov 13, 2019
e1ed0cc
CWG2429 Initialization of thread_local variables referenced by lambdas
Nov 13, 2019
21f5dec
CWG2430 Completeness of return and parameter types of member functions
Nov 13, 2019
6d05c69
CWG2431 Full-expressions and temporaries bound to references
Nov 13, 2019
b7e6e5e
CWG2432 Return types for defaulted <=>
Nov 13, 2019
2140e55
CWG2433 Variable templates in the ODR
Nov 13, 2019
752c82b
CWG2437 Conversion of std::strong_ordering in a defaulted operator<=>
Nov 13, 2019
fd20a44
CWG2442 Incorrect requirement for default arguments
Nov 13, 2019
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
14 changes: 7 additions & 7 deletions source/algorithms.tex
Original file line number Diff line number Diff line change
Expand Up @@ -9773,19 +9773,19 @@
\pnum
\expects
\tcode{a} and \tcode{b} point to, respectively,
elements $\tcode{x}[i]$ and $\tcode{x}[j]$ of the same array object \tcode{x}.
elements $i$ and $j$ of the same array object \tcode{x}.
\begin{note}
An object that is not an array element is considered to belong
to a single-element array for this purpose; see \ref{expr.unary.op}.
A pointer past the last element of an array \tcode{x} of $n$ elements
As specified in \ref{basic.compound},
an object that is not an array element
is considered to belong to a single-element array for this purpose and
a pointer past the last element of an array of $n$ elements
is considered to be equivalent to a pointer
to a hypothetical element $\tcode{x}[n]$ for this purpose;
see \ref{basic.compound}.
to a hypothetical array element $n$ for this purpose.
\end{note}

\pnum
\returns
A pointer to $\tcode{x}[i+\frac{j-i}{2}]$,
A pointer to array element $i+\frac{j-i}{2}$ of \tcode{x},
where the result of the division is truncated towards zero.
\end{itemdescr}

Expand Down
28 changes: 14 additions & 14 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -561,14 +561,8 @@
\begin{itemize}
\item class type\iref{class},
\item enumeration type\iref{dcl.enum},
\item inline function or variable\iref{dcl.inline} with external linkage,
\item class template\iref{temp},
\item non-static function template\iref{temp.fct},
\item concept\iref{temp.concept},
\item static data member of a class template\iref{temp.static},
\item member function of a class template\iref{temp.mem.func},
\item template specialization for which some template parameters are not
specified~(\ref{temp.spec}, \ref{temp.class.spec}),
\item inline function or variable\iref{dcl.inline},
\item templated entity\iref{temp.pre},
\item default argument for a parameter (for a function in a given scope)%
\iref{dcl.fct.default}, or
\item default template argument\iref{temp.param}
Expand Down Expand Up @@ -3581,7 +3575,7 @@
All variables which do not have dynamic storage duration, do not have thread
storage duration, and are not local
have \defn{static storage duration}. The
storage for these entities shall last for the duration of the
storage for these entities lasts for the duration of the
program~(\ref{basic.start.static}, \ref{basic.start.term}).

\pnum
Expand Down Expand Up @@ -3610,14 +3604,17 @@
\pnum
All variables declared with the \tcode{thread_local} keyword have
\defnadj{thread}{storage duration}.
The storage for these entities shall last for the duration of
The storage for these entities lasts for the duration of
the thread in which they are created. There is a distinct object or reference
per thread, and use of the declared name refers to the entity associated with
the current thread.

\pnum
A variable with thread storage duration shall be initialized before
its first odr-use\iref{basic.def.odr} and, if constructed, shall be destroyed on thread exit.
\begin{note}
A variable with thread storage duration is initialized as specified
in~\ref{basic.start.static}, \ref{basic.start.dynamic}, and \ref{stmt.dcl}
and, if constructed, is destroyed on thread exit\iref{basic.start.term}.
\end{note}

\rSec3[basic.stc.auto]{Automatic storage duration}

Expand Down Expand Up @@ -5058,7 +5055,9 @@
a pointer past the end of the last element of
an array \tcode{x} of $n$ elements
is considered to be equivalent to
a pointer to a hypothetical element \tcode{x[$n$]}.
a pointer to a hypothetical array element $n$ of \tcode{x} and
an object of type \tcode{T} that is not an array element
is considered to belong to an array with one element of type \tcode{T}.
The value representation of
pointer types is \impldef{value representation of pointer types}. Pointers to
layout-compatible types shall
Expand Down Expand Up @@ -5351,7 +5350,8 @@
including the constituent expressions of the initializer,
\item
an invocation of a destructor generated at the end of the lifetime
of an object other than a temporary object\iref{class.temporary}, or
of an object other than a temporary object\iref{class.temporary}
whose lifetime has not been extended, or
\item
an expression that is not a subexpression of another expression and
that is not otherwise part of a full-expression.
Expand Down
69 changes: 22 additions & 47 deletions source/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -944,8 +944,8 @@
access syntax~(\ref{expr.ref}, \ref{over.match.call}). A non-static
member function may also be called directly using the function call
syntax~(\ref{expr.call}, \ref{over.match.call}) from within
the body of a member function of its class or of a class derived from
its class.
its class or a class derived from its class, or
a member thereof, as described below.

\pnum
\indextext{member function!call undefined}%
Expand Down Expand Up @@ -973,14 +973,7 @@
If \tcode{C} is not \tcode{X} or a base class of \tcode{X}, the class
member access expression is ill-formed.
\end{note}
Similarly during name lookup, when an
\grammarterm{unqualified-id}\iref{expr.prim.id.unqual} used in the definition of a
member function for class \tcode{X} resolves to a static member,
an enumerator or a nested type of class \tcode{X} or of a base class of
\tcode{X}, the \grammarterm{unqualified-id} is transformed into a
\grammarterm{qualified-id}\iref{expr.prim.id.qual} in which the
\grammarterm{nested-name-specifier} names the class of the member function.
These transformations do not apply in the
This transformation does not apply in the
template definition context\iref{temp.dep.type}.
\begin{example}
\begin{codeblock}
Expand Down Expand Up @@ -2314,7 +2307,8 @@
the destructor is invoked.
\end{note}
A destructor can also be invoked explicitly. A destructor is \term{potentially invoked}
if it is invoked or as specified in~\ref{expr.new}, \ref{dcl.init.aggr},
if it is invoked or as specified in~\ref{expr.new},
\ref{stmt.return}, \ref{dcl.init.aggr},
\ref{class.base.init}, and~\ref{except.throw}.
A program is ill-formed if a destructor that is potentially invoked is deleted
or not accessible from the context of the invocation.
Expand Down Expand Up @@ -2752,22 +2746,6 @@
\end{codeblock}
\end{example}

\pnum
If an \grammarterm{unqualified-id}\iref{expr.prim.id.unqual} is used in the
definition of a static member following the member's
\grammarterm{declarator-id}, and name lookup\iref{basic.lookup.unqual}
finds that the \grammarterm{unqualified-id} refers to a static
member, enumerator, or nested type of the member's class (or of a base
class of the member's class), the \grammarterm{unqualified-id} is
transformed into a \grammarterm{qualified-id} expression in which the
\grammarterm{nested-name-specifier} names the class scope from which the
member is referenced.
\begin{note}
See~\ref{expr.prim.id} for restrictions on the use of non-static data
members and non-static member functions.
\end{note}


\pnum
Static members obey the usual class member access rules\iref{class.access}.
When used in the declaration of a class
Expand Down Expand Up @@ -3273,10 +3251,8 @@
Each \grammarterm{member-declaration} in the \grammarterm{member-specification}
of an anonymous union shall either define a non-static data member or be a
\grammarterm{static_assert-declaration}.
\begin{note}
Nested types, anonymous unions, and functions cannot be declared within an anonymous
union.
\end{note}
Nested types, anonymous unions, and functions
shall not be declared within an anonymous union.
The names of the members of an anonymous union shall be distinct from
the names of any other entity in the scope in which the anonymous union
is declared. For the purpose of name lookup, after the anonymous union
Expand Down Expand Up @@ -6818,7 +6794,7 @@

\pnum
The \defnadj{synthesized}{three-way comparison}
for comparison category type \tcode{R}\iref{cmp.categories}
of type \tcode{R}\iref{cmp.categories}
of glvalues \tcode{a} and \tcode{b} of the same type
is defined as follows:

Expand Down Expand Up @@ -6880,28 +6856,27 @@
\end{note}

\pnum
Let \tcode{R} be the declared return type of
a defaulted three-way comparison operator function.
Given an expanded list of subobjects for an object \tcode{x} of type \tcode{C},
the type of the expression $\tcode{x}_i$ \tcode{<=>} $\tcode{x}_i$
is denoted by $\tcode{R}_i$.
If overload resolution as applied to $\tcode{x}_i$ \tcode{<=>} $\tcode{x}_i$
does not find a usable function,
then $\tcode{R}_i$ is \tcode{void}.
If the declared return type
of a defaulted three-way comparison operator function
is \tcode{auto},
let $\tcode{R}_i$ be
the type of the expression $\tcode{x}_i$ \tcode{<=>} $\tcode{x}_i$, or
\tcode{void} if overload resolution applied to that expression
does not find a usable function.
\begin{itemize}
\item
If \tcode{R} is \tcode{auto},
then the return type is deduced as
the common comparison type (see below) of
$\tcode{R}_0$, $\tcode{R}_1$, $\dotsc$, $\tcode{R}_{n-1}$.
If the return type is deduced as \tcode{void},
the operator function is defined as deleted.
If the declared return type of
a defaulted three-way comparison operator function
is \tcode{R}
and the synthesized three-way comparison
for comparison category type \tcode{R}
\item
Otherwise, if the synthesized three-way comparison of type \tcode{R}
between any objects $\tcode{x}_i$ and $\tcode{x}_i$
is not defined or would be ill-formed,
the operator function is defined as deleted.
\end{itemize}

\pnum
The return value \tcode{V} of type \tcode{R}
Expand All @@ -6912,13 +6887,13 @@
in the expanded lists of subobjects for \tcode{x} and \tcode{y}
(in increasing index order)
until the first index $i$ where
the synthesized three-way comparison for comparison category type \tcode{R}
the synthesized three-way comparison of type \tcode{R}
between $\tcode{x}_i$ and $\tcode{y}_i$
yields a result value $\tcode{v}_i$ where $\tcode{v}_i \mathrel{\tcode{!=}} 0$,
contextually converted to \tcode{bool}, yields \tcode{true};
\tcode{V} is $\tcode{v}_i$.
If no such index exists, \tcode{V} is
\tcode{std::strong_ordering::equal} converted to \tcode{R}.
\tcode{static_cast<R>(std::strong_ordering::equal)}.

\pnum
The \defn{common comparison type} \tcode{U}
Expand Down
18 changes: 6 additions & 12 deletions source/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -886,13 +886,6 @@
whose \grammarterm{function-body} is not \tcode{= delete}
shall additionally satisfy the following requirements:
\begin{itemize}
\item
if the class is a union having variant members\iref{class.union}, exactly one of them
shall be initialized;

\item
if the class is a union-like class, but is not a union, for each of its anonymous union
members having variant members, exactly one of them shall be initialized;

\item
for a non-delegating constructor, every constructor selected to initialize non-static
Expand Down Expand Up @@ -5612,12 +5605,13 @@
\end{example}

\item Otherwise, if \tcode{T} is an enumeration
with a fixed underlying type\iref{dcl.enum},
the \grammarterm{initializer-list} has a single element \tcode{v}, and
with a fixed underlying type\iref{dcl.enum} \tcode{U},
the \grammarterm{initializer-list} has a single element \tcode{v},
\tcode{v} can be implicitly converted to \tcode{U}, and
the initialization is direct-list-initialization,
the object is initialized with the value \tcode{T(v)}\iref{expr.type.conv};
if a narrowing conversion is required to convert \tcode{v}
to the underlying type of \tcode{T}, the program is ill-formed.
to \tcode{U}, the program is ill-formed.
\begin{example}
\begin{codeblock}
enum byte : unsigned char { };
Expand Down Expand Up @@ -5895,8 +5889,8 @@
A function shall be defined only in namespace or class scope.
The type of a parameter or the return type for a function
definition shall not be
an incomplete or abstract (possibly cv-qualified) class type
in the context of the function definition
a (possibly cv-qualified) class type that is
incomplete or abstract within the function body
unless the function is deleted\iref{dcl.fct.def.delete}.

\pnum
Expand Down
Loading