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

--- Comment #32 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Wed Jan  8 20:31:20 2020
New Revision: 280018

URL: https://gcc.gnu.org/viewcvs?rev=280018&root=gcc&view=rev
Log:
        PR c++/91369 - constexpr destructor and member initializer.

Previously it didn't matter whether we looked through a TARGET_EXPR in
constexpr evaluation, but now that we have constexpr destructors it does.
On IRC I mentioned the idea of clearing TARGET_EXPR_CLEANUP in
digest_nsdmi_init, but since this initialization is expressed by an
INIT_EXPR, it's better to handle all INIT_EXPR, not just those for a member
initializer.

        * constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
        when not preevaluating.

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

Reply via email to