]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR c++/88752 - ICE with lambda and constexpr if.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 31 Jan 2019 15:03:21 +0000 (15:03 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 31 Jan 2019 15:03:21 +0000 (15:03 +0000)
commit8c28f0efefea6a4c18c659816b064c9aa93660b1
tree973524d03603c0ee792bc11ddd3b89c0974682f1
parentc194927177a61f60440a59cd518145d243b2737f
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268424 138bc75d-0d04-0410-961f-82ee72b054a4
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]