This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28477] New: Intermediate template classes makes typdefs in base class go away
- From: "krister_joas at ml dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jul 2006 09:12:15 -0000
- Subject: [Bug c++/28477] New: Intermediate template classes makes typdefs in base class go away
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The below piece of code fails with the following error:
f.C: In member function 'virtual int E<T>::f()':
f.C:18: error: 'b' was not declared in this scope
f.C:18: error: expected `;' before 'i'
f.C:18: error: 'i' was not declared in this scope
File f.C:
class Base
{
public:
typedef int b;
};
template<class T>
class D : public Base
{
public:
virtual int f() { return 0; }
};
template<class T>
class E : public D<T>
{
public:
virtual int f() { b i; i = 1; return i; }
};
int main()
{
}
--
Summary: Intermediate template classes makes typdefs in base
class go away
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: krister_joas at ml dot com
GCC target triplet: sparc-sun-solaris2.10
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28477