You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
... should print "hello true world!" but with libc++ prints "hello 1 world!".
This also presumably means that a multithreaded program that constructs an Init object has a data race. This seems straightforward to fix by adding a static one-time initialization guard to the iso_base::Init constructor.
It might also be reasonable to maintain an atomic count of the number of extant Init objects so that the flushes in the destructor are only run when the last one is destroyed, as [ios.init]/4 requires. I think that the current destructor behavior might even result in observable nonconformance in programs that call cout.rdbuf(stream) and observe when stream sees writes.
The text was updated successfully, but these errors were encountered: