]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: make -Wctad-maybe-unsupported respect complain [PR105143]
authorPatrick Palka <ppalka@redhat.com>
Wed, 6 Apr 2022 15:46:25 +0000 (11:46 -0400)
committerPatrick Palka <ppalka@redhat.com>
Thu, 7 Apr 2022 19:18:57 +0000 (15:18 -0400)
commit4e47b450b72f082de6fba7a060c3a751954e6c17
tree7b9e35df2bf6439264193cbbe34f976aabe16ec2
parent214330a15cd7fd52e574023152f1321c6d329e82
c++: make -Wctad-maybe-unsupported respect complain [PR105143]

We were attempting to issue a -Wctad-maybe-unsupported warning even when
complain=tf_none, which led to a crash in the first testcase below and a
bogus error during overload resolution in the second testcase.

PR c++/105143

gcc/cp/ChangeLog:

* pt.c (do_class_deduction): Check complain before attempting
to issue a -Wctad-maybe-unsupported warning.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/nodiscard1.C: New test.
* g++.dg/warn/Wctad-maybe-unsupported4.C: New test.

(cherry picked from commit e58484a019c57b1085bbbcc1654f1944feddfe73)
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp2a/nodiscard1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wctad-maybe-unsupported4.C [new file with mode: 0644]