Re: [C++ PATCH] PR c++/91369 - Implement P0784R7: constexpr new

2019-10-05 Thread Jakub Jelinek
On Fri, Oct 04, 2019 at 03:34:39PM -0400, Jason Merrill wrote: > > @@ -1656,6 +1671,64 @@ cxx_eval_call_expression (const constexp > >lval, non_constant_p, overflow_p); > > if (!DECL_DECLARED_CONSTEXPR_P (fun)) > > { > > + if (cxx_dialect >= cx

Re: [C++ PATCH] PR c++/91369 - Implement P0784R7: constexpr new

2019-10-04 Thread Jason Merrill
On 10/4/19 1:50 PM, Jakub Jelinek wrote: On Thu, Oct 03, 2019 at 04:07:14PM -0400, Jason Merrill wrote: I believe it doesn't, because the heap VAR_DECLs are TREE_STATIC (things really don't work at all if they aren't). Ah, sure. I suppose you could clear TREE_STATIC from them before the verif

Re: [C++ PATCH] PR c++/91369 - Implement P0784R7: constexpr new

2019-10-04 Thread Jakub Jelinek
On Thu, Oct 03, 2019 at 04:07:14PM -0400, Jason Merrill wrote: > > I believe it doesn't, because the heap VAR_DECLs are TREE_STATIC (things > > really don't work at all if they aren't). > > Ah, sure. I suppose you could clear TREE_STATIC from them before the > verify_constant in this function? T

Re: [C++ PATCH] PR c++/91369 - Implement P0784R7: constexpr new

2019-10-03 Thread Jason Merrill
On 10/3/19 2:38 PM, Jakub Jelinek wrote: On Tue, Oct 01, 2019 at 05:56:00PM -0400, Jason Merrill wrote: + else if (DECL_NAME (var) == heap_deleted_identifier) + { + if (!ctx->quiet) + error_at (loc, "deallocation of alre

Re: [C++ PATCH] PR c++/91369 - Implement P0784R7: constexpr new

2019-10-03 Thread Jakub Jelinek
On Tue, Oct 01, 2019 at 05:56:00PM -0400, Jason Merrill wrote: > > + else if (DECL_NAME (var) == heap_deleted_identifier) > > + { > > + if (!ctx->quiet) > > + error_at (loc, "deallocation of already deallocated " > > +

Re: [C++ PATCH] PR c++/91369 - Implement P0784R7: constexpr new

2019-10-02 Thread Jason Merrill
On 10/2/19 7:36 AM, Jakub Jelinek wrote: Hi! Thanks for the review, let me start with the unrelated bugfixes then and deal with the rest later. On Tue, Oct 01, 2019 at 05:56:00PM -0400, Jason Merrill wrote: @@ -3905,7 +4033,7 @@ cxx_eval_store_expression (const constex bool no_zero_init =

Re: [C++ PATCH] PR c++/91369 - Implement P0784R7: constexpr new

2019-10-02 Thread Jakub Jelinek
Hi! Thanks for the review, let me start with the unrelated bugfixes then and deal with the rest later. On Tue, Oct 01, 2019 at 05:56:00PM -0400, Jason Merrill wrote: > > @@ -3905,7 +4033,7 @@ cxx_eval_store_expression (const constex > > bool no_zero_init = true; > > releasing_vec ctors; >

Re: [C++ PATCH] PR c++/91369 - Implement P0784R7: constexpr new

2019-10-01 Thread Jason Merrill
On 9/27/19 4:31 PM, Jakub Jelinek wrote: Hi! The following patch attempts to implement P0784R7, which includes constexpr destructors and constexpr new/delete/new[]/delete[]. ::operator new is allowed during constexpr evaluation and returns address of an artificial VAR_DECL with special name. A

[C++ PATCH] PR c++/91369 - Implement P0784R7: constexpr new

2019-09-27 Thread Jakub Jelinek
Hi! The following patch attempts to implement P0784R7, which includes constexpr destructors and constexpr new/delete/new[]/delete[]. ::operator new is allowed during constexpr evaluation and returns address of an artificial VAR_DECL with special name. At this point we don't really know the type