This is the mail archive of the gcc-bugs@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]

C++: template in namespace


> The non-template version compiles.  This version compiles and runs
> correctly on older versions (egcs-1.1.2).

Thanks for your bug report. A patch is included below.

This patch removes a false error from gcc 2.95; ok to apply to both
branches?

1999-08-08  Martin v. Loewis  <martin@mira.isdn.cs.tu-berlin.de>

	* decl2.c (set_decl_namespace): Do not complain about non-matching
	decls if processing a template.

Index: decl2.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl2.c,v
retrieving revision 1.229
diff -u -p -r1.229 decl2.c
--- decl2.c	1999/08/07 22:28:50	1.229
+++ decl2.c	1999/08/08 09:04:08
@@ -4498,6 +4498,10 @@ set_decl_namespace (decl, scope, friendp
       /* Since decl is a function, old should contain a function decl. */
       if (!is_overloaded_fn (old))
 	goto complain;
+      if (processing_template_decl || processing_specialization)
+	/* We have not reduced the fndef to template_def, yet, so
+	   the decls don't match.  */
+	return;
       for (; old; old = OVL_NEXT (old))
 	if (decls_match (decl, OVL_CURRENT (old)))
 	  return;


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