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]

PATCH for Re: Code generation Bug with egcs-1.0.2



Here's a fix.  Jason, is this OK?

-- 
Mark Mitchell <mmitchell@usa.net>
http://home.earthlink.net/~mbmitchell
Consulting Services Available

Mon Apr 20 16:55:55 1998  Mark Mitchell  <mmitchell@usa.net>

	* decl2.c (grokfield): Remangle the name of a member TYPE_DECL.

Index: gcc/cp/decl2.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl2.c,v
retrieving revision 1.61
diff -c -p -r1.61 decl2.c
*** decl2.c	1998/04/17 15:29:44	1.61
--- decl2.c	1998/04/20 23:54:14
*************** grokfield (declarator, declspecs, init, 
*** 1586,1591 ****
--- 1589,1603 ----
        DECL_CONTEXT (value) = current_class_type;
        DECL_CLASS_CONTEXT (value) = current_class_type;
        CLASSTYPE_LOCAL_TYPEDECLS (current_class_type) = 1;
+ 
+       if (current_class_type != NULL_TREE)
+ 	{
+ 	  /* Now that we've updated the context, we need to remangle the
+ 	     name for this TYPE_DECL.  */
+ 	  DECL_ASSEMBLER_NAME (value) = DECL_NAME (value);
+ 	  DECL_ASSEMBLER_NAME (value) =
+ 	    get_identifier (build_overload_name (TREE_TYPE (value), 1, 1));
+ 	}
  
        pushdecl_class_level (value);
        return value;
Index: gcc/testsuite/g++.old-deja/g++.pt/typedef3.C
===================================================================
RCS file: typedef3.C
diff -N typedef3.C
*** /dev/null	Mon Dec 31 20:00:00 1979
--- typedef3.C	Mon Apr 20 16:54:14 1998
***************
*** 0 ****
--- 1,23 ----
+ template <class T>
+ void f(T, T)
+ {
+ }
+ 
+ struct A {
+   typedef enum {
+     VAL1
+   } result_t;
+ };
+ 
+ struct B {
+   typedef enum {
+     VAL2
+   } result_t;
+ };
+ 
+ 
+ void g()
+ {
+   f(A::VAL1, A::VAL1);
+   f(B::VAL2, B::VAL2);
+ }


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