Skip to content

Commit 33f16cb

Browse files
jensmaurerzygoloid
authored andcommitted
[dcl.attr.nodiscard] Clarify example with reference return type. (#1471)
Add rationale why a warning is not encouraged for this case. Fixes #1470.
1 parent 0f1e91e commit 33f16cb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/declarations.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4104,7 +4104,8 @@
41044104
launch_missiles();
41054105
}
41064106
error_info &foo();
4107-
void f() { foo(); } // reference type, warning not encouraged
4107+
void f() { foo(); } // warning not encouraged: not a nodiscard call, because neither
4108+
// the (reference) return type nor the function is declared nodiscard
41084109
\end{codeblock}
41094110
\end{example}
41104111

0 commit comments

Comments
 (0)