This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/12221] fstream.tcc:463: error: expected unqualified-id
- From: "alexander dot riesen at synopsys dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Sep 2003 10:27:50 -0000
- Subject: [Bug libstdc++/12221] fstream.tcc:463: error: expected unqualified-id
- References: <20030909095340.12221.alexander.riesen@synopsys.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12221
------- Additional Comments From alexander dot riesen at synopsys dot com 2003-09-09 10:27 -------
Subject: Re: fstream.tcc:463: error: expected unqualified-id
gdr at integrable-solutions dot net, Tue, Sep 09, 2003 12:18:32 +0200:
>
> | For such code:
> |
> | #include <algorithm>
> | // some header file doing #define:
> | #define min(a,b) ((a)<(b)?(a): (b))
> | #include <fstream>
>
> This is not a problem in the library. The code is simply bogus.
> min is a reserved name. This PR should be resolved invalid.
>
I'm not saying the library is wrong.
Of course the code _is_ bogus! The problem is, there is a lot of
such code out there.
If the PR is invalid, why there is "undef min" (and max) in the
stl_algobase.h, line 128?
Can there be any help for a sore programmer confronting the problem next
time? Just a hint to help to identify the place where the macro
redefines a reserved word?
-alex