Skip to content

Commit f897604

Browse files
jensmaurerzygoloid
authored andcommitted
[class.temporary] Remove note giving questionable implementation advice.
And move the surviving part of the note to before the corresponding example. Fixes #1674.
1 parent 10e4c74 commit f897604

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

source/special.tex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,13 +607,15 @@
607607

608608
\item The lifetime of a temporary bound to the returned value in a function return statement~(\ref{stmt.return}) is not extended; the temporary is destroyed at the end of the full-expression in the return statement.
609609

610-
\item A temporary bound to a reference in a \grammarterm{new-initializer}~(\ref{expr.new}) persists until the completion of the full-expression containing the \grammarterm{new-initializer}. \begin{example}
610+
\item A temporary bound to a reference in a \grammarterm{new-initializer}~(\ref{expr.new}) persists until the completion of the full-expression containing the \grammarterm{new-initializer}.
611+
\begin{note} This may introduce a dangling reference. \end{note}
612+
\begin{example}
611613
\begin{codeblock}
612614
struct S { int mi; const std::pair<int,int>& mp; };
613615
S a { 1, {2,3} };
614616
S* p = new S{ 1, {2,3} }; // creates dangling reference
615617
\end{codeblock}
616-
\end{example} \begin{note} This may introduce a dangling reference, and implementations should issue a warning in such a case. \end{note}
618+
\end{example}
617619
\end{itemize}
618620

619621
\pnum

0 commit comments

Comments
 (0)