Re: [PATCH] Fix PR c++/16160

2015-01-14 Thread Jason Merrill
On 01/14/2015 05:04 PM, Patrick Palka wrote: Did this define a specialization too: struct X<5> { }; Yes. There's an example in the ARM that says A class can be defined as the definition of a template class. For example, template class stream { /* ... */ }; class stream { /* ... */

Re: [PATCH] Fix PR c++/16160

2015-01-14 Thread Patrick Palka
On Wed, Jan 14, 2015 at 4:28 PM, Jason Merrill wrote: > On 01/14/2015 11:28 AM, Patrick Palka wrote: >> >> Second, since the user probably intended to >> have written an explicit template instantiation (as in the PR), the FE >> should suggest adding "template" before such a declaration, that is th

Re: [PATCH] Fix PR c++/16160

2015-01-14 Thread Jason Merrill
On 01/14/2015 11:28 AM, Patrick Palka wrote: Second, since the user probably intended to have written an explicit template instantiation (as in the PR), the FE should suggest adding "template" before such a declaration, that is the declaration struct X<5>; // error + suggest adding "templat

Re: [PATCH] Fix PR c++/16160

2015-01-14 Thread Patrick Palka
On Wed, Jan 14, 2015 at 8:26 AM, Patrick Palka wrote: > On Wed, Jan 14, 2015 at 8:05 AM, Jason Merrill wrote: >> On 01/13/2015 10:54 PM, Patrick Palka wrote: >>> >>> + type = error_mark_node; >>> + goto out; >> >> >> Why exit early in the explicit instantiation cases? Doesn't it

Re: [PATCH] Fix PR c++/16160

2015-01-14 Thread Patrick Palka
On Wed, Jan 14, 2015 at 8:05 AM, Jason Merrill wrote: > On 01/13/2015 10:54 PM, Patrick Palka wrote: >> >> + type = error_mark_node; >> + goto out; > > > Why exit early in the explicit instantiation cases? Doesn't it work to give > the error and continue? > > Jason > Yes it does.

Re: [PATCH] Fix PR c++/16160

2015-01-14 Thread Jason Merrill
On 01/13/2015 10:54 PM, Patrick Palka wrote: + type = error_mark_node; + goto out; Why exit early in the explicit instantiation cases? Doesn't it work to give the error and continue? Jason