[C++ PATCH] Avoid ice-on-invalid in xref_basetypes (PR c++/34089)

Mark Mitchell mark@codesourcery.com
Tue Nov 20 11:43:00 GMT 2007


Jakub Jelinek wrote:

> 2007-11-19  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR c++/34089
> 	* parser.c (cp_parser_class_specifier): Don't call xref_basetypes
> 	if type is not aggregate type.
> 
> 	* g++.dg/template/crash74.C: New test.

This seems like it would work, but why are we event accepting this code
in cp_parser_class_head?

+template<typename F> void foo () { }
+template<typename F> struct foo<F> { };

Here, we know that foo is not a name for a class template, so we should
be able to detect the error at that point.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list