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: demangling bug


This patch fixed a problem with ordering of asterisks and ampersands
in multiply-indirected pointer/reference types (e.g. `int*&').

in libiberty:

	* cp-demangle.c (demangle_type_ptr): Increment position past
	pointer and reference characters.



Index: cp-demangle.c
===================================================================
RCS file: /cvs/gcc/egcs/libiberty/cp-demangle.c,v
retrieving revision 1.18
diff -c -p -r1.18 cp-demangle.c
*** cp-demangle.c	2000/09/05 03:07:14	1.18
--- cp-demangle.c	2000/09/05 03:46:19
*************** demangle_type_ptr (dm, insert_pos, subst
*** 2015,2020 ****
--- 2015,2023 ----
        /* Insert an asterisk where we're told to; it doesn't
  	 necessarily go at the end.  */
        RETURN_IF_ERROR (result_insert_char (dm, *insert_pos, '*'));
+       /* The next (outermost) pointer or reference character should go
+ 	 after this one.  */
+       ++(*insert_pos);
      }
    else if (next == 'R')
      {
*************** demangle_type_ptr (dm, insert_pos, subst
*** 2026,2031 ****
--- 2029,2037 ----
        /* Insert an ampersand where we're told to; it doesn't
  	 necessarily go at the end.  */
        RETURN_IF_ERROR (result_insert_char (dm, *insert_pos, '&'));
+       /* The next (outermost) pointer or reference character should go
+ 	 after this one.  */
+       ++(*insert_pos);
      }
    else if (next == 'M')
      {

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