This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12057] New: gcc compilation errors for nested template classes.
- From: "sharadmp at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Aug 2003 18:41:02 -0000
- Subject: [Bug c++/12057] New: gcc compilation errors for nested template classes.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12057
Summary: gcc compilation errors for nested template classes.
Product: gcc
Version: 2.96 (redhat)
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sharadmp at yahoo dot com
CC: gcc-bugs at gcc dot gnu dot org,sharadmp at yahoo dot
com
Iam trying to compile c++ code with nested classes. The compiler gcc 2.96
gives following error:
'ArrayListImpl<ValueType>::Itr' doesnot have a nested type named `Impl`
My brief code snippet is shown below:It uses friend class as shown.
template<class ValueType = Object> class ArrayListImpl :
public List<ValueType::Impl {
private:
class Itr;
class Itr::Impl; //GIVES ABOVE ERROR AT THIS LINE//
......
friend class Itr;
}
template<class ValueType> class ArrayListImpl<ValueType>::Itr :
public Iterator<ValueType>{
private:
class Impl : public Iterator<ValueType>::Impl {
....
friend class Itr;
};
}