PR c++/86740, ICE with constexpr if and nested generic lambdas.
authorJason Merrill <jason@redhat.com>
Thu, 17 Jan 2019 20:36:31 +0000 (15:36 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 17 Jan 2019 20:36:31 +0000 (15:36 -0500)
commitf18aa3a4078f83540903c5d1f5c4ad0e25597ab1
tree5a6852032534ed4ce9f9e1915acde44e905f4037
parentba29ed0f57b5005586e49d40aaec55d943caff61
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.

From-SVN: r268046
gcc/cp/ChangeLog
gcc/cp/tree.c
gcc/testsuite/g++.dg/cpp1z/constexpr-if25.C [new file with mode: 0644]