This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
egcs bug: local classes in member functions of template classes
- To: <egcs-bugs at egcs dot cygnus dot com>
- Subject: egcs bug: local classes in member functions of template classes
- From: "Chris Uzdavinis" <chris at atdesk dot com>
- Date: Fri, 28 May 1999 22:19:08 -0400
Hi, you guys are doing a superb job with egcs. But I ran into some code
that caused a message to send a bug report to you.
The following code generates an internal compiler error. It seems the
"local class" in a member function of a template class is the cause. I
moved class goo out of the function and it compiled cleanly. Also, when I
made foo a non-templatized class, it also compiled cleanly.
I'm using egcs 2.91.57 on linux (I believe it's Red Hat 5.5). If there is
any more information you need, I'm sorry I omitted it, this is my first egcs
bug report <g>. If there's a bug-submission faq, I apologise for not having
it (or knowing where it is... hmm, maybe a URL to the bug submission faq
would be good to add to the internal compiler error message?)
Chris
class base
{
public:
virtual void blah()=0;
};
class Callbacker
{
public:
void callback(base *obj)
{
obj->blah();
}
};
template <class T>
class foo
{
public:
void bar(Callbacker *cb)
{
class goo : public base {
public:
void blah() { }
};
goo g;
cb->callback(&g);
}
};
main()
{
Callback cb;
foo<int> f;
f.bar(&cb);
}