PR c++/88752 - ICE with lambda and constexpr if.
authorJason Merrill <jason@redhat.com>
Thu, 31 Jan 2019 15:03:21 +0000 (10:03 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 31 Jan 2019 15:03:21 +0000 (10:03 -0500)
commit636ecb78a36df20232be05fd4fa2bdbea67c5551
tree973524d03603c0ee792bc11ddd3b89c0974682f1
parentf942ef18b84ff6fd5774a606357e4ebcec120da3
PR c++/88752 - ICE with lambda and constexpr if.

In this testcase, we look for an instantiation of the outer lambda from
within the inner lambda.  enclosing_instantiation_of didn't handle this
properly, as it assumed that any references would be from the same lambda
nesting depth.  Fixed thus.

* cp-tree.h (LAMBDA_EXPR_INSTANTIATED): New.
* pt.c (tsubst_lambda_expr): Set it.
(instantiated_lambda_fn_p): Check it.
(enclosing_instantiation_of): Use it.

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