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 { /* ... */
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
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
Here is version 2 of the patch which only adjusts a couple of testcases
in g++.old-deja/ that I missed earlier. I am unsure if the extra
dg-error in overload.C is correct.
No code changes yet in gcc/cp/ versus the original patch. Successfully
bootstrapped and regtested on x86_64-unknown-linux-gn
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
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.
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
This patch fixes the above PR where it was reported that the C++
frontend does not reject the malformed class declaration
struct X<5>;
Instead of rejecting it, the FE treats this declaration as if it were a
forward declaration of a template specialization, i.e. as if it were
written
temp