This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/88449] __builtin_is_constant_evaluated misbehaves due to constexpr call caching


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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Wed Dec 12 08:28:43 2018
New Revision: 267044

URL: https://gcc.gnu.org/viewcvs?rev=267044&root=gcc&view=rev
Log:
        PR c++/88449
        * constexpr.c (struct constexpr_call): Add pretend_const_required
        member.
        (constexpr_call_hasher::equal): Return false if pretend_const_required
        members differ.
        (cxx_eval_call_expression): Adjust new_call initialization.  Hash in
        ctx->pretend_const_required.

        * g++.dg/cpp2a/is-constant-evaluated1.C: Change from dg-do compile
        to dg-do run.
        (e): Adjust comment with correct expected value.
        (main): Expect e == 1.
        * g++.dg/cpp2a/is-constant-evaluated2.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/constexpr.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated1.C

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]