PR c++/89070 - bogus [[nodiscard]] warning in SFINAE.
authorMarek Polacek <polacek@redhat.com>
Wed, 13 Nov 2019 15:59:53 +0000 (15:59 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 13 Nov 2019 15:59:53 +0000 (15:59 +0000)
commit7b521fbd43b3cbaf4313c7719bed72d4de3b49a9
treec86966eafc86c3b5324e227941a89502db30c147
parent2aaf32ab603d05d7ddc12c7ec1db3314044cf91a
PR c++/89070 - bogus [[nodiscard]] warning in SFINAE.

This is a complaint that we issue a [[nodiscard]] warning even in SFINAE
contexts.  Here 'complain' is tf_decltype, but not tf_warning so I guess
we can fix it as below.

* cvt.c (convert_to_void): Guard maybe_warn_nodiscard calls with
tf_warning.

* g++.dg/cpp1z/nodiscard7.C: New test.

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