This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Bug, in the library, I think
On Thu, Sep 27, 2001 at 07:42:37PM -0400, Ken Yarnall wrote:
>
> A student of mine encountered a bug, using gcc 3.0.1. Her code looks
> more or less like
>
> class error {};
> #include <iostream>
>
> This causes parsing errors in bits/codecvt.h. The problem is that
> codecvt_base contains an enum (result) which lists "error" as one of its
> members. Code in the indirect derived class codecvt refers to "error"
> without qualification.
>
> ... The solution
> seems to be to qualify references to codecvt_base::error.
The analysis is correct, and your solution would work. Generally
we prefer the shorter "this->error", though, where it works.
Can you send in a patch, please? Extra credit for a fully-formulated
test case with global definitions of all the base-class names. (This
will probably reveal other errors which might be included in the patch.
Arguably the test case is more important than the patch, if you don't
have time to fix 'em all.)
Does CVS current have a -W flag to detect and report these?
Nathan Myers
ncm at cantrip dot org