[Bug c++/10530] [3.4 regression] Cannot access non-dependent type within nested template

GccBugs at Skyler dot com gcc-bugzilla@gcc.gnu.org
Mon Jul 21 01:16:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10530



------- Additional Comments From GccBugs at Skyler dot com  2003-07-21 01:16 -------
Is this related:

struct	Base2	{	};

template<class T>
struct	Base1
{
	template<class U>
	struct	TypeDef	{	typedef	Base2	SecondBase;	};
};

template<class T>
struct	Derived	:	public	Base1<int>,
									public
	Base1<T>::TypeDef<float>::SecondBase
{	};

int	main	(void)
{	Derived<long>	derived;	}

g++ 3.2 under Cygwin in Win2K produces:

t.cpp: In instantiation of `Derived<long int>':
t.cpp:16:   instantiated from here
t.cpp:16: base class `Base1<T>::TypeDef<float>::SecondBase' has incomplete type

Make either template a non-template class and the error message goes away.



More information about the Gcc-bugs mailing list