This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
libstdc++/5297: operator!() const incorrect for fstream class
- From: us at ooc dot de
- To: gcc-gnats at gcc dot gnu dot org
- Date: 7 Jan 2002 13:41:41 -0000
- Subject: libstdc++/5297: operator!() const incorrect for fstream class
- Reply-to: us at ooc dot de
>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: