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]

C++ PATCH for member-template/name-look



We weren't allowing a use of member class-templates in a similarly
scoped member function.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

1999-05-25  Mark Mitchell  <mark@codesourcery.com>

	* pt.c (lookup_template_class): Tweak lookup to find member
	templates.

Index: testsuite/g++.old-deja/g++.pt/memclass21.C
===================================================================
RCS file: memclass21.C
diff -N memclass21.C
--- /dev/null	Sat Dec  5 20:30:03 1998
+++ memclass21.C	Tue May 25 11:31:14 1999
@@ -0,0 +1,11 @@
+// Build don't link:
+// Origin: <Corey Kosak> kosak@cs.cmu.edu
+
+struct moo {
+  template<bool x> struct cow {};
+
+  template<bool x>
+  struct moo2 {
+    void func(cow<x> &c) { }
+  };
+};
Index: testsuite/cp/pt.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/pt.c,v
retrieving revision 1.305
diff -u -p -r1.305 pt.c
--- pt.c	1999/05/22 19:00:23	1.305
+++ pt.c	1999/05/25 18:31:36
@@ -3613,12 +3613,8 @@ lookup_template_class (d1, arglist, in_d
 	{
 	  if (context)
 	    push_decl_namespace (context);
-	  if (current_class_type != NULL_TREE)
-	    template =
-	      maybe_get_template_decl_from_type_decl
-	      (IDENTIFIER_CLASS_VALUE (d1));
-	  if (template == NULL_TREE)
-	    template = lookup_name_nonclass (d1);
+	  template = lookup_name (d1, /*prefer_type=*/0);
+	  template = maybe_get_template_decl_from_type_decl (template);
 	  if (context)
 	    pop_decl_namespace ();
 	}


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