This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Bug Found!
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Bug Found!
- From: Charles <charles at altair dot dhs dot org>
- Date: Fri, 3 Mar 2000 19:55:10 -0800
The following is a nice and annoying bug:
For "gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)"
Compiling C++:
g++ -g -fno-exceptions -fno-rtti -fno-check-new -Wall -pedantic -W
-Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long -fno-builtin
template <class T>
class TemplateClass
{
// ...
};
class TheClass
{
// ...
TemplateClass<TheClass*> templateClass;
};
It complains that on the line "class TheClass", TheClass has been redefined
and that it's already defined at the template instantiation.
I've never tested this on any other compiler, but, either way, it doesn't seem
right. That's like saying you can't keep a pointer to yourself...
Many Thanks
-Charles