This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/31323] typename A::B * p; in template definition, with curiously recurring template inheritance
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Mar 2007 06:26:06 -0000
- Subject: [Bug c++/31323] typename A::B * p; in template definition, with curiously recurring template inheritance
- References: <bug-31323-10874@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from bangerth at dealii dot org 2007-03-23 06:26 -------
Or smaller like this:
------------------
template <class T> struct Base {
typename T::X X;
};
struct A : Base<A>
{
typedef int X;
};
------------------
sunCC also rejects it. I tend to believe that the code is invalid because
at the time where we instantiate Base<A> (in the base class list of A), A
is not complete and so the inner typedef is not available yet.
What makes you think that the code should compile?
W.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bangerth at dealii dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31323