Nested derived template class
Michael Schwendt
mschwendt@web.de
Thu Jul 6 14:13:00 GMT 2000
Red Hat Linux release 6.2 (Zoot)
i386 on i586 CPU with 64 MB RAM
gcc 2.95.2 (installed for testing purposes only, because
egcs 1.1.2 does not give this reported error)
glibc 2.1.3
libstdc++.so.2.8.0 and 2.9 (not needed)
libg++.so.2.7.2.8 (not needed)
Options used: g++ s.cpp -c
A nested derived template class gives an internal compiler
error while a non-nested version of the code compiles fine.
// Internal compiler error.
// Please submit a full bug report.
// See <URL: http://www.gnu.org/software/gcc/faq.html#bugreport > for instructions.
class A
{
template<class T> class SmartPtrBase
{
public:
T a;
SmartPtrBase(T);
};
template<class T> class SmartPtr : public SmartPtrBase<T>
{
public:
SmartPtr(T b) : SmartPtrBase<T>(b) { }
};
};
int main(int,char**)
{
char c;
A::SmartPtr<char> p(c);
exit(0);
}
Regards,
Mike
More information about the Gcc-bugs
mailing list