Re: [PR c++/78469] default ctor makes dtor required

2017-01-24 Thread Jason Merrill
OK. On Tue, Jan 24, 2017 at 2:17 PM, Nathan Sidwell wrote: > On 01/24/2017 11:36 AM, Jason Merrill wrote: > >> This is the wrong place for this; we don't know at this point whether >> we're in a new-expression or actually creating a temporary. I think we >> want to add this flag in the call to b

Re: [PR c++/78469] default ctor makes dtor required

2017-01-24 Thread Nathan Sidwell
On 01/24/2017 11:36 AM, Jason Merrill wrote: This is the wrong place for this; we don't know at this point whether we're in a new-expression or actually creating a temporary. I think we want to add this flag in the call to build_value_init from build_new_1. And look at other calls to build_valu

Re: [PR c++/78469] default ctor makes dtor required

2017-01-24 Thread Jason Merrill
On 01/24/2017 09:13 AM, Nathan Sidwell wrote: On 01/23/2017 05:01 PM, Jason Merrill wrote: I suppose adding a tsubst flag isn't too horrible. But then we also need to audit other uses of build_value_init to decide whether they should build a cleanup or not. @@ -8055,7 +8055,8 @@ build_over_

Re: [PR c++/78469] default ctor makes dtor required

2017-01-24 Thread Nathan Sidwell
On 01/23/2017 05:01 PM, Jason Merrill wrote: I suppose adding a tsubst flag isn't too horrible. But then we also need to audit other uses of build_value_init to decide whether they should build a cleanup or not. Not too ugly, I guess. Looking at the other calls that end up at build_target_e

Re: [PR c++/78469] default ctor makes dtor required

2017-01-23 Thread Jason Merrill
On Wed, Jan 18, 2017 at 1:25 PM, Nathan Sidwell wrote: > I've figured out what's happening here. Just not sure of the most prudent > way to fix it. > > struct no_destr { > no_destr() = default; > > protected: > ~no_destr() = default; > }; > > void *Foo () > { > return new no_destr (); > } >

Re: [PR c++/78469] default ctor makes dtor required

2017-01-23 Thread Nathan Sidwell
ping? On 01/18/2017 01:25 PM, Nathan Sidwell wrote: Jason, I've figured out what's happening here. Just not sure of the most prudent way to fix it. struct no_destr { no_destr() = default; protected: ~no_destr() = default; }; void *Foo () { return new no_destr (); } no_destr is a type