Skip to content
Merged
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
14 changes: 14 additions & 0 deletions source/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1950,6 +1950,20 @@
and $E$ is the \grammarterm{assignment-expression}.
\end{itemize}
\item
For an explicit type conversion\iref{expr.type.conv},
\tcode{T} is the specified type, which shall be \keyword{auto}.
\begin{itemize}
\item
If the initializer is a \grammarterm{braced-init-list},
it shall consist of a single brace-enclosed \grammarterm{assignment-expression}
and $E$ is the \grammarterm{assignment-expression}.
\item
If the initializer is a parenthesized \grammarterm{expression-list},
the \grammarterm{expression-list} shall be
a single \grammarterm{assignment-expression}
and $E$ is the \grammarterm{assignment-expression}.
Comment on lines +1961 to +1964
Copy link
Contributor

Choose a reason for hiding this comment

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

It's weird to say this explicitly for auto(4) but not for auto x(4);, since the latter's initializer is (4). It's preexisting, but should we adjust /2.2 (or even try to combine them)?

Copy link
Member

Choose a reason for hiding this comment

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

But... we say that in p2.2.3:

If the initializer is a parenthesized expression-list, the expression-list shall be a single assignment-expression and E is the assignment-expression

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd say let's leave this for now? I'm not sure what exactly we could improve here.

\end{itemize}
\item
For a non-type template parameter declared with a type
that contains a placeholder type,
\tcode{T} is the declared type of the non-type template parameter
Expand Down
11 changes: 3 additions & 8 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3353,14 +3353,9 @@
of the function selected by overload resolution
for class template deduction\iref{over.match.class.deduct}
for the remainder of this subclause.
Otherwise, if the type is \tcode{auto},
it is replaced by the type deduced for the variable \tcode{x}
in the invented declaration\iref{dcl.spec.auto},
which is never interpreted as a function declaration:
\begin{codeblock}
auto x @\placeholder{init}@;
\end{codeblock}
, where \placeholder{init} is the initializer.
Otherwise, if the type contains a placeholder type,
it is replaced by the type
determined by placeholder type deduction\iref{dcl.type.auto.deduct}.
\begin{example}
\begin{codeblock}
struct A {};
Expand Down