Skip to content

Commit 7822730

Browse files
committed
[dcl.type.auto.deduct] Clarify initializer for placeholder type deduction.
1 parent 0a1ce7e commit 7822730

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

source/declarations.tex

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1923,25 +1923,28 @@
19231923
are determined as follows:
19241924
\begin{itemize}
19251925
\item
1926-
for a non-discarded \tcode{return} statement that occurs
1926+
For a non-discarded \tcode{return} statement that occurs
19271927
in a function declared with a return type
19281928
that contains a placeholder type,
19291929
\tcode{T} is the declared return type
19301930
and $E$ is the operand of the \tcode{return} statement.
19311931
If the \tcode{return} statement
19321932
has no operand,
1933-
then $E$ is \tcode{void()};
1933+
then $E$ is \tcode{void()}.
19341934
\item
1935-
for a variable declared with a type
1935+
For a variable declared with a type
19361936
that contains a placeholder type,
1937-
\tcode{T} is the declared type of the variable
1938-
and $E$ is the initializer.
1937+
\tcode{T} is the declared type of the variable.
1938+
If the initializer of the variable is a \grammarterm{brace-or-equal-initializer}
1939+
of the form \tcode{= \grammarterm{initializer-clause}},
1940+
$E$ is the \grammarterm{initializer-clause}.
19391941
If the initialization is direct-list-initialization,
19401942
the initializer shall be a \grammarterm{braced-init-list}
19411943
containing only a single \grammarterm{assignment-expression}
1942-
and $E$ is the \grammarterm{assignment-expression};
1944+
and $E$ is the \grammarterm{assignment-expression}.
1945+
Otherwise, $E$ is the initializer.
19431946
\item
1944-
for a non-type template parameter declared with a type
1947+
For a non-type template parameter declared with a type
19451948
that contains a placeholder type,
19461949
\tcode{T} is the declared type of the non-type template parameter
19471950
and $E$ is the corresponding template argument.

0 commit comments

Comments
 (0)