The inclusion of <string> makes the word `minor' special (g++)?
Sergey Zaharchenko
doublef@tele-kom.ru
Tue Oct 5 18:37:00 GMT 2004
Hello list,
I'm not sure whether it is a bug, or I am overlooking something, but I
have the problem best described by this printout (with and without the
#include):
Script started on Tue Oct 5 16:41:54 2004
$ g++ -v
Using built-in specs.
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 3.4.2 [FreeBSD] 20040728
$ cat 1.cc
class minor
{
int i;
public:
minor():i(0){}
};
int
main(void)
{
}
$ cat 2.cc
#include <string>
class minor
{
int i;
public:
minor():i(0){}
};
int
main(void)
{
}
$ g++ 1.cc
$ g++ 2.cc
2.cc:8: error: expected unqualified-id before "int"
2.cc:8: error: expected `)' before "int"
2.cc:8: error: expected `)' before "int"
FWIW, g++ 2.95.4 doesn't barf at any of the sources.
If I change the name `minor' to something else, everything works. But
what if I happen to like the name:)?
Please CC me in any replies.
TIA,
--
DoubleF
"Humor is a drug which it's the fashion to abuse."
-- William Gilbert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20041005/4d210a07/attachment.sig>
More information about the Gcc-help
mailing list