455. cerr::tie() and wcerr::tie() are overspecified

Section: 31.4 [iostream.objects] Status: CD1 Submitter: Bill Plauger Opened: 2004-01-30 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [iostream.objects].

View all issues with CD1 status.

Discussion:

Both cerr::tie() and wcerr::tie() are obliged to be null at program startup. This is overspecification and overkill. It is both traditional and useful to tie cerr to cout, to ensure that standard output is drained whenever an error message is written. This behavior should at least be permitted if not required. Same for wcerr::tie().

Proposed resolution:

Add to the description of cerr:

After the object cerr is initialized, cerr.tie() returns &cout. Its state is otherwise the same as required for basic_ios<char>::init (lib.basic.ios.cons).

Add to the description of wcerr:

After the object wcerr is initialized, wcerr.tie() returns &wcout. Its state is otherwise the same as required for basic_ios<wchar_t>::init (lib.basic.ios.cons).

[Sydney: straw poll (3-1): we should require, not just permit, cout and cerr to be tied on startup. Pre-Redmond: Bill will provide wording.]