This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/846: stream types non-const members
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/846: stream types non-const members
- From: richarda at ixla dot com dot au
- Date: 19 Nov 2000 23:12:57 -0000
- Reply-To: richarda at ixla dot com dot au
>Number: 846
>Category: c++
>Synopsis: stream types non-const members
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Nov 19 15:16:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: Richard Andrews
>Release: libstdc++-2.90.8
>Organization:
>Environment:
i686-pc-linux-gnu (RH6.2 gcc2.95.2)
>Description:
libstdc++-2.90.8
is_open() member of stream types is const in some
parts of the hierarchy but not others.
When inheriting from fstream, is_open() is no longer a
const member.
It is obvious that it is an error in some places as
is_open() merely calls another const member.
ie. (bits/std_fstream.h)
bool
is_open(void) { return rdbuf()->is_open(); }
>How-To-Repeat:
class A : private fstream
{
public:
bool isOpen() const
{
return is_open()
};
}
>Fix:
ensure is_open() is a const member of all stream types.
>Release-Note:
>Audit-Trail:
>Unformatted: