------- Comment #5 from redi at gcc dot gnu dot org  2010-07-15 16:38 -------
This is why you should only include <iostream> if you want actually want
std::cin, std::cout or std::cerr (or the wide character equivalents.)
Otherwise you should only include one or more of <iosfwd>, <istream> and
<ostream>, as needed.


(In reply to comment #3)
> ... and are we required to emit the constructor even if we know var is not
> used?

27.4 [iostream.objects] paragraph 2
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. Similarly, the entire program shall behave as if there were at least
one instance of ios_base::Init with static storage duration.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44952

Reply via email to