This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11546] New: Type lookup problems in out-of-line definition of a class doubly nested from a template class
- From: "fgccbz0 at greynode dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jul 2003 13:08:39 -0000
- Subject: [Bug c++/11546] New: Type lookup problems in out-of-line definition of a class doubly nested from a template class
- 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=11546
Summary: Type lookup problems in out-of-line definition of a
class doubly nested from a template class
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: fgccbz0 at greynode dot net
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
The following code does not compile as expected:
template <class T0>
class A {
public:
class B;
};
template <class T0>
class A<T0>::B {
public:
class C;
};
template <class T0>
class A<T0>::B::C {
public:
A<T0> &a;
};
I originally tried with the redhat 9 gcc-3.2, which ICE'd. I then followed up by
downloading and compiling vanilla gcc-3.3 from ftp.gnu.org. With the g++ from
that compile, the above code produces:
Foo.cpp:16: error: non-template type `A' used as a template
Foo.cpp:16: error: ISO C++ forbids declaration of `a' with no type
Since A most definitely is a template, I think this is wrong. I've seen other
weird behaviour with more complex examples, but this seems like a good starting
point.