[Bug c++/88983] ICE in label_matches, at cp/constexpr.c:4035

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Feb 1 00:31:00 GMT 2019


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

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Fri Feb  1 00:30:46 2019
New Revision: 268438

URL: https://gcc.gnu.org/viewcvs?rev=268438&root=gcc&view=rev
Log:
        PR c++/88983 - ICE with switch in constexpr function.
        * constexpr.c (cxx_eval_switch_expr): Use SWITCH_COND and SWITCH_BODY.
        (cxx_eval_constant_expression) <case COND_EXPR>: Don't look for the
        label in the else branch if we found it in the then branch.

        * g++.dg/cpp1y/constexpr-88983.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/cpp1y/constexpr-88983.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/constexpr.c
    trunk/gcc/testsuite/ChangeLog


More information about the Gcc-bugs mailing list