https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86740
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> --- Author: jason Date: Thu Jan 17 20:36:31 2019 New Revision: 268046 URL: https://gcc.gnu.org/viewcvs?rev=268046&root=gcc&view=rev Log: PR c++/86740, ICE with constexpr if and nested generic lambdas. When we partially instantiate the constexpr if, we walk through its body to see what it uses from the enclosing local_specializations. That walk was overlooking the use of 'count' in the captures of the innermost lambda, because we weren't walking into the capture list. * tree.c (cp_walk_subtrees): Handle LAMBDA_EXPR. Added: trunk/gcc/testsuite/g++.dg/cpp1z/constexpr-if25.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/tree.c