c++: Avoid [[nodiscard]] warning in requires-expr [PR98019]
authorJason Merrill <jason@redhat.com>
Wed, 9 Dec 2020 02:47:11 +0000 (21:47 -0500)
committerJason Merrill <jason@redhat.com>
Wed, 9 Dec 2020 05:36:07 +0000 (00:36 -0500)
commitc3a63fb3854392af65a191154e3586e7f5a1066e
treebd153bc97384ebe5bb874f1424a0049f86dc49b1
parent4eb28483004f8291c1f17df3b242716a5151c180
c++: Avoid [[nodiscard]] warning in requires-expr [PR98019]

If we aren't really evaluating the expression, it doesn't matter that the
return value is discarded.

gcc/cp/ChangeLog:

PR c++/98019
* cvt.c (maybe_warn_nodiscard): Check c_inhibit_evaluation_warnings.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/concepts-nodiscard1.C: Remove xfail.
gcc/cp/cvt.c
gcc/testsuite/g++.dg/cpp2a/concepts-nodiscard1.C