[Bug c++/19143] New: [4.0 regression] ICE on invalid template parameter

Alexandre Oliva aoliva@redhat.com
Wed Dec 29 08:04:00 GMT 2004


On Dec 23, 2004, "reichelt at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> wrote:

> The following invalid code snippet triggers an ICE on mainline:
> ==============================================
> template<int> struct A;
> template<> struct A<template> {};
> ==============================================

> bug.cc:2: error: missing '>' to terminate the template argument list
> bug.cc:2: error: template argument 1 is invalid
> bug.cc:2: error: missing '>' to terminate the template argument list
> bug.cc:2: error: template argument 1 is invalid
> bug.cc:2: error: 'A' is not a template
> bug.cc:2: error: missing '>' to terminate the template argument list
> bug.cc:2: internal compiler error: Segmentation fault
> Please submit a full bug report, [etc.]

> Alexandre, this was causes by your path for PR18757:
> http://gcc.gnu.org/ml/gcc-cvs/2004-12/msg00382.html

> Could you please have a look?

This patch fixes it, but I'm not entirely sure this is the best
location for this test.  Tested on amd64-linux-gnu, no failures.  Ok
to install?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cp-dont-crash-on-tmpl-args-parse-error.patch
Type: text/x-patch
Size: 769 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20041229/552417f0/attachment.bin>
-------------- next part --------------

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}


More information about the Gcc-patches mailing list