https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88752

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Thu Jan 31 15:03:21 2019
New Revision: 268424

URL: https://gcc.gnu.org/viewcvs?rev=268424&root=gcc&view=rev
Log:
        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.

Added:
    trunk/gcc/testsuite/g++.dg/cpp1z/constexpr-if26.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/pt.c

Reply via email to