This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: 3.3 C++ PATCH to instantiate_class_template for c++/10661


On 08 May 2003 17:04:10 -0700, Mark Mitchell <mark@codesourcery.com> wrote:

> On Thu, 2003-05-08 at 12:49, Jason Merrill wrote:
>> 10661 is a bug whereby implicit typename is causing us to try to
>> instantiate a nested class without instantiating its enclosing class,
>> causing an ICE.  This patch fixes the testcase.  We could also give a
>> diagnostic here, so that people know that their code is ill-formed, but
>> that seems less safe than this patch.  Is this OK for 3.3?
>
> Would you post the test-case, please?

Reduced testcase attached below.

> My initial inclination is that this is a 3.3.1, but not 3.3, issue. 
> (This is an ICE-on-illegal, due to the use of implicit typename.)

Makes sense to me.

Jason

template <class A>
struct Foo
{
	static const int var = 0; 

	template <class>
	struct Nested
	{
		static const int nested_var = var;
	}; 
};

template <class A>
struct Bar
{
    typename Foo<A>::Nested<void> a;
};

template struct Bar<void>;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]