This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Late cc1plus patch for 1.1.2


After Neal Becker's report
(http://egcs.cygnus.com/ml/egcs-bugs/1999-03/msg00145.html), I tried
to back-port the patch

1998-09-08  Martin von Löwis  <loewis@informatik.hu-berlin.de>

	* decl.c (make_typename_type): If context is a namespace, the code
	is in error.

Unfortunately, the patch does not work in 1.1.2-pre as-is, since the
formatting of %T is more restrictive. I've change the patch as shown
below.

If possible, this should be integrated into 1.1.2.

Thanks,
Martin

Index: decl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl.c,v
retrieving revision 1.152.2.12
diff -c -p -r1.152.2.12 decl.c
*** decl.c	1998/11/09 09:32:01	1.152.2.12
--- decl.c	1999/03/04 17:38:46
*************** make_typename_type (context, name)
*** 4702,4707 ****
--- 4702,4716 ----

    fullname = name;

+   if (TREE_CODE (context) == NAMESPACE_DECL)
+     {
+       /* We can get here from typename_sub0 in the explicit_template_type
+ 	 expansion.  Just fail.  */
+       cp_error ("no class template named `%D' in `%D'",
+ 		name, context);
+       return error_mark_node;
+     }
+
    if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
      {
        name = TREE_OPERAND (name, 0);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]