Title
The effects of including <iostream> on initialization are not yet precisely specified
Status
new
Section
[iostream.objects.overview]
Submitter
Jiang An

Created on 2023-03-27.00:00:00 last changed 18 months ago

Messages

Date: 2023-05-24.14:33:00

Proposed resolution:

This wording is relative to n4944.

  1. Change [iostream.objects.overview]/5 as indicated:

    -5- The results of including <iostream> in a translation unit shall be as if <iostream> defined an instance of ios_base::Init with static storage duration ordered initialization ([basic.start.dynamic]). Each C++ library module ([std.modules]) in a hosted implementation shall behave as if it contains an interface unit that defines an unexported ios_base::Init variable with ordered initialization ([basic.start.dynamic]).

Date: 2023-05-15.00:00:00

[ 2023-05-24; Reflector poll ]

Set priority to 4 after reflector poll.

Date: 2023-03-27.00:00:00

LWG 3878 specified the effects of importing standard library modules on initialization. However, the effects of including <iostream> are not yet precisely specified. A hostile reading may consider this to allow the ios_base::Init variable to be a function-local static variable or an inline variable, which defeats the purpose.

History
Date User Action Args
2023-05-24 14:33:00adminsetmessages: + msg13566
2023-03-27 14:46:04adminsetmessages: + msg13496
2023-03-27 00:00:00admincreate