This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++: fix for template ICE
- To: gcc-patches at gcc dot gnu dot org
- Subject: C++: fix for template ICE
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Sun, 8 Aug 1999 14:34:47 +0200
> Here is more info about how to obtain ICE 980422 in gcc 2.95 when using
> member templates.
Thanks for your bug report. Here is a patch.
Ok to install in the release branch as well?
Regards,
Martin
1999-08-08 Martin v. Loewis <martin@mira.isdn.cs.tu-berlin.de>
* pt.c (mangle_class_name_for_template): Support types as context
of a template.
Index: pt.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/pt.c,v
retrieving revision 1.322
diff -u -r1.322 pt.c
--- pt.c 1999/08/07 21:53:40 1.322
+++ pt.c 1999/08/08 10:57:04
@@ -3485,8 +3485,12 @@
tree context = DECL_CONTEXT (arg);
if (context)
{
- my_friendly_assert (TREE_CODE (context) == NAMESPACE_DECL, 980422);
- cat(decl_as_string (DECL_CONTEXT (arg), 0));
+ if (TREE_CODE (context) == NAMESPACE_DECL)
+ cat (decl_as_string (context, 0));
+ else if (TYPE_P (context))
+ cat (type_as_string (context, 0));
+ else
+ my_friendly_abort (980422);
cat("::");
}
cat (IDENTIFIER_POINTER (DECL_NAME (arg)));