Subject: Re: CWG710 and races during object construction
From: Jason Cobb (jason.e.cobb_at_[hidden])
Date: 2021-02-11 12:25:59
On 2/11/21 1:15 PM, Giuseppe D'Angelo via Std-Discussion wrote:
> On 11/02/2021 19:05, Jason Cobb via Std-Discussion wrote:
>> I think  has you covered for UB in case 1. The typeid does not
>> happen-before the destruction of the global, so it's UB to pass the
>> glvalue to typeid.
> I'm not sure; doesn't that entire sentence (the four bullet point) refer
> to the "Otherwise" case above (I.e. object is not under construction or
> destruction)? Otherwise, does something like 7.2 mean you can't call a
> non-static member function on *this from a constructor?
Right, if it happened-before the end of the constructor (when not in the
"Otherwise" case),  applies. But if it doesn't happen-before the end
of the constructor,  still applies.
(Disclaimer: I'm an idiot and this could all be very wrong.)
-- Jason Cobb
STD-DISCUSSION list run by firstname.lastname@example.org
Older Archives on Google Groups