re PR c++/80896 ([[nodiscard]] is ignored for functions returning references)
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 1 Jun 2017 10:20:27 +0000 (10:20 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 1 Jun 2017 10:20:27 +0000 (10:20 +0000)
commitac853c9071ab9a8df483c26fe8672732546c51ab
tree840e9172b123a07168d915101b1f9441c3c29348
parent7841f13c8064c7d8f4eb13acd396bd0455e12c26
re PR c++/80896 ([[nodiscard]] is ignored for functions returning references)

/cp
2017-06-01  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/80896
* cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
for case INDIRECT_REF too in the main switch.

/testsuite
2017-06-01  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/80896
* g++.dg/cpp1z/nodiscard5.C: New.

From-SVN: r248784
gcc/cp/ChangeLog
gcc/cp/cvt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1z/nodiscard5.C [new file with mode: 0644]