C++ Logo


Advanced search

Re: CWG710 and races during object construction

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Thu, 11 Feb 2021 19:15:17 +0100

On 11/02/2021 19:05, Jason Cobb via Std-Discussion wrote:
> I think [0] 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.
> [0]:https://eel.is/c++draft/basic.life#7.4

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?

Giuseppe D'Angelo | giuseppe.dangelo_at_[hidden] | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

Received on 2021-02-11 12:15:23