[Bug c++/83273] if constexpr does not fail with run-time conditions

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Dec 4 22:52:00 GMT 2017


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

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Mon Dec  4 22:52:07 2017
New Revision: 255390

URL: https://gcc.gnu.org/viewcvs?rev=255390&root=gcc&view=rev
Log:
        PR c++/83273 - constexpr if allows non-constant condition

        * semantics.c (finish_if_stmt_cond): Use require_constant_expression
        rather than is_constant_expression.
        * constexpr.c (potential_constant_expression_1) [LAMBDA_EXPR]: Allow
        in C++17.

Added:
    trunk/gcc/testsuite/g++.dg/cpp1z/constexpr-if13.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/constexpr.c
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/g++.dg/cpp1z/constexpr-if12.C


More information about the Gcc-bugs mailing list