OSDN Git Service

* cplus-dem.c (demangle_prefix): Use the last __
authoramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 13 Nov 1998 05:55:40 +0000 (05:55 +0000)
committeramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 13 Nov 1998 05:55:40 +0000 (05:55 +0000)
in the mangled name when looking for the signature. This allows
template names to begin with __.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23627 138bc75d-0d04-0410-961f-82ee72b054a4

libiberty/ChangeLog
libiberty/cplus-dem.c

index 0e339dc..d4a9015 100644 (file)
@@ -1,3 +1,9 @@
+Fri Nov 13 08:51:46 EST 1998  Andrew MacLeod  <amacleod@cygnus.com>
+
+       *cplus-dem.c (demangle_prefix): Use the last "__"
+       in the mangled name when looking for the signature. This allows
+       template names to begin with "__".
+
 1998-11-08  Mark Mitchell  <mark@markmitchell.com>
 
        * cplus-dem.c (type_kind_t): Add tk_reference.
index 9b3c5ad..5ccf92f 100644 (file)
@@ -2005,7 +2005,15 @@ demangle_prefix (work, mangled, declp)
            }
          else
            {
-             demangle_function_name (work, mangled, declp, scan);
+              const char *tmp;
+              /* Look for the LAST occurrence of __, allowing names to have
+                 the '__' sequence embedded in them.*/
+              while ((tmp = mystrstr (scan+2, "__")) != NULL)
+                scan = tmp;
+              if (*(scan + 2) == '\0')
+                success = 0;
+              else
+                demangle_function_name (work, mangled, declp, scan);
            }
        }
     }