re PR c++/91369 (Implement P0784R7: constexpr new)
authorJakub Jelinek <jakub@redhat.com>
Tue, 7 Jan 2020 07:13:50 +0000 (08:13 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 7 Jan 2020 07:13:50 +0000 (08:13 +0100)
commitf74f6092ace420bd8a4498697754b06fc6da63bd
treecca42358fa3b5c25e78f163588388996a048c043
parent6ac22177a085e0ba36c95e71cee8235cc8b12947
re PR c++/91369 (Implement P0784R7: constexpr new)

PR c++/91369
* constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
member, initialize it to zero in ctor.
(cxx_eval_call_expression): Bump heap_dealloc_count when deleting
a heap object.  Don't cache calls to functions which allocate some
heap objects and don't deallocate them or deallocate some heap
objects they didn't allocate.

* g++.dg/cpp1y/constexpr-new.C: Expect an error explaining why
static_assert failed for C++2a.
* g++.dg/cpp2a/constexpr-new9.C: New test.

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