This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]