You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/special.tex
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -607,13 +607,15 @@
607
607
608
608
\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.
609
609
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}
611
613
\begin{codeblock}
612
614
struct S { int mi; const std::pair<int,int>& mp; };
613
615
S a { 1, {2,3} };
614
616
S* p = new S{ 1, {2,3} }; // creates dangling reference
615
617
\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}
0 commit comments