[Bug c++/55639] Partial nested template specialization leads to segmentation fault of g++

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55639

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |8.0

--- Comment #5 from Jason Merrill  ---
(In reply to Paolo Carlini from comment #1)
> The issue is the 'template' keyword in:
> 
> SomeClass::template Fun

Indeed, the keyword is not allowed in a class-head-name:

The keyword template is said to appear at the top level in a qualified-id if it
appears outside of a template-argument-list or decltype-specifier. In a
qualified-id of a declarator-id or in a qualified-id formed by a
class-head-name or enum-head-name, the keyword template shall not appear at the
top level.

For GCC 8, I've fixed G++ to accept it with a pedwarn.

[Bug c++/55639] Partial nested template specialization leads to segmentation fault of g++

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55639

--- Comment #4 from Jason Merrill  ---
Author: jason
Date: Wed Jun 28 19:41:49 2017
New Revision: 249754

URL: https://gcc.gnu.org/viewcvs?rev=249754&root=gcc&view=rev
Log:
PR c++/55639 - partial specialization with ::template

* parser.c (cp_parser_class_head): Handle ::template.

Added:
trunk/gcc/testsuite/g++.dg/template/partial-specialization8.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c

[Bug c++/55639] Partial nested template specialization leads to segmentation fault of g++

2017-06-27 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55639

Jason Merrill  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-06-28
 CC||jason at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org
 Ever confirmed|0   |1

[Bug c++/55639] Partial nested template specialization leads to segmentation fault of g++

2012-12-10 Thread paolo.carlini at oracle dot com


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



--- Comment #3 from Paolo Carlini  2012-12-10 
14:23:16 UTC ---

It is, it is.


[Bug c++/55639] Partial nested template specialization leads to segmentation fault of g++

2012-12-10 Thread veksler at il dot ibm.com


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



Michael Veksler  changed:



   What|Removed |Added



 CC||veksler at il dot ibm.com



--- Comment #2 from Michael Veksler  2012-12-10 
14:18:07 UTC ---

I have a possibly similar test case (can someone confirm if my case is a DUP?).





--- t.cpp --

template 

struct A {

   template 

   struct B;

};



template 

struct A::template B<0> {

   int foo();

};



 end --



$ /opt/gcc4.7.2/bin/g++ t.cpp

t.cpp:8:23: internal compiler error: Segmentation fault

Please submit a full bug report,

with preprocessed source if appropriate.

See  for instructions.



$/opt/gcc4.7.2/bin/g++ -v

Using built-in specs.

COLLECT_GCC=/opt/gcc4.7.2/bin/g++

COLLECT_LTO_WRAPPER=/opt/gcc4.7.2/libexec/gcc/x86_64-unknown-linux-gnu/4.7.2/lto-wrapper

Target: x86_64-unknown-linux-gnu

Configured with: ../gcc-4.7.2/configure --prefix=/opt/gcc4.7.2

Thread model: posix

gcc version 4.7.2 (GCC)


[Bug c++/55639] Partial nested template specialization leads to segmentation fault of g++

2012-12-10 Thread paolo.carlini at oracle dot com


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



--- Comment #1 from Paolo Carlini  2012-12-10 
13:40:18 UTC ---

The issue is the 'template' keyword in:



SomeClass::template Fun



without it, the code is accepted (ICC also accepts it). I'm pretty sure this is

a Dup of another issue we already have in Bugzilla.