struct A { typedef void (A::*B) (); operator B (); }; template <typename> struct C { void foo () { d == 0; } A d; }; ICEs on the trunk, likely starting with r256804. Either constexpr.c needs to be taught to handle various processing_template_decl only tree codes, or we should have caught it earlier, like somewhere in is_nondependent_constant_expression or functions it calls.
I should note that it ICEs only with -Wall or -Wtautological-compare.
Am testing a fix for this.
Candidate patch: https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01955.html
Author: dmalcolm Date: Tue Jan 23 21:19:09 2018 New Revision: 256999 URL: https://gcc.gnu.org/viewcvs?rev=256999&root=gcc&view=rev Log: C++: Fix ICE in fold_for_warn on CAST_EXPR (PR c++/83974) gcc/cp/ChangeLog: PR c++/83974 * pt.c (tsubst_copy_and_build) <CONSTRUCTOR>: Remove early bailout for pointer to member function types. gcc/testsuite/ChangeLog: PR c++/83974 * g++.dg/warn/pr83974.C: New test case. Added: trunk/gcc/testsuite/g++.dg/warn/pr83974.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c trunk/gcc/testsuite/ChangeLog
Should be fixed by r256999.