libstdc++/5297: operator!() const incorrect for fstream class

us@ooc.de us@ooc.de
Mon Jan 7 05:46:00 GMT 2002


>Number:         5297
>Category:       libstdc++
>Synopsis:       operator!() const incorrect for fstream class
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 07 05:46:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Uwe Seimet
>Release:        gcc version 3.0.3
>Organization:
>Environment:
Linux duplo 2.4.17 #1 SMP Thu Dec 27 09:22:23 MET 2001 i686 unknown
>Description:
operator!() const does not seem to call fail(), as mandated
by the ISO C++ standard, 27.4.4.3. This code fragment:

    fstream afile(MYNAME, ios::in|ios::out|ios::app);
    assert(afile);

always leads to an assertion, even when the stream could be
opened correctly. Looks as if fail() is not called at all,
at least operator!() always seems to return false.
 
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-prs mailing list