]> 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>
Wed, 6 Apr 2022 15:46:25 +0000 (11:46 -0400)
commite58484a019c57b1085bbbcc1654f1944feddfe73
tree74dad14767627d66ead130887ecab79b4635a465
parent6283d5ad4779d3e5b7b2a93e76de03264a7c7cc6
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.cc (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.
gcc/cp/pt.cc
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]