https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105143
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:4e47b450b72f082de6fba7a060c3a751954e6c17 commit r11-9797-g4e47b450b72f082de6fba7a060c3a751954e6c17 Author: Patrick Palka <ppa...@redhat.com> Date: Wed Apr 6 11:46:25 2022 -0400 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)