[Bug libstdc++/12221] fstream.tcc:463: error: expected unqualified-id
alexander dot riesen at synopsys dot com
gcc-bugzilla@gcc.gnu.org
Tue Sep 9 10:27:00 GMT 2003
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
More information about the Gcc-bugs
mailing list