]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR c++/91369 - constexpr destructor and member initializer.
authorJason Merrill <jason@redhat.com>
Wed, 8 Jan 2020 20:31:20 +0000 (15:31 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 8 Jan 2020 20:31:20 +0000 (15:31 -0500)
commit10d2f801f472931137deae1714d5b690c1862037
treef13bc24987acc7188124e8414df9cc31ed103b00
parentcd3ca6cb1129b1e80b5b048a59aa3a0c387c2413
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.

From-SVN: r280018
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/testsuite/g++.dg/cpp2a/constexpr-new10.C [new file with mode: 0644]