d-demangle.c (dlang_parse_symbol): Skip over anonymous symbols.
authorIain Buclaw <ibuclaw@gdcproject.org>
Mon, 1 May 2017 10:50:58 +0000 (10:50 +0000)
committerIain Buclaw <ibuclaw@gcc.gnu.org>
Mon, 1 May 2017 10:50:58 +0000 (10:50 +0000)
libiberty/ChangeLog:

* d-demangle.c (dlang_parse_symbol): Skip over anonymous symbols.
* testsuite/d-demangle-expected: Add tests.

From-SVN: r247434

libiberty/ChangeLog
libiberty/d-demangle.c
libiberty/testsuite/d-demangle-expected

index 7aa4821d61080a80ebcbd759ca14a51eab889c0d..c5c566d83bcff67da7e11cc96779b392e689d464 100644 (file)
@@ -1,4 +1,9 @@
-2017-04-15  Iain Buclaw  <ibuclaw@gdcproject.org>
+2017-05-01  Iain Buclaw  <ibuclaw@gdcproject.org>
+
+       * d-demangle.c (dlang_parse_symbol): Skip over anonymous symbols.
+       * testsuite/d-demangle-expected: Add tests.
+
+2017-05-01  Iain Buclaw  <ibuclaw@gdcproject.org>
 
        * d-demangle.c (dlang_identifier): Handle template constraint symbols.
        (dlang_parse_template): Only advance if template symbol prefix is
index 74dde9d9b0c79a411dfb41529dde662ac03b172f..533653fde2f4e6679bb8258dd518a896a83a9f44 100644 (file)
@@ -1362,6 +1362,10 @@ dlang_parse_symbol (string *decl, const char *mangled,
       if (n++)
        string_append (decl, ".");
 
+      /* Skip over anonymous symbols.  */
+      while (*mangled == '0')
+       mangled++;
+
       mangled = dlang_identifier (decl, mangled, kind);
 
       if (mangled && dlang_call_convention_p (mangled))
index 6725684ff332f911283b4d5f6cb8427195818e46..530e0e62bffa7d35e37888cb1894d8bfe7621983 100644 (file)
@@ -929,6 +929,14 @@ demangle.test(char() delegate shared inout)
 _D8demangle4testFDONgxFZaZv
 demangle.test(char() delegate shared inout const)
 #
+--format=dlang
+_D8demangle004testFaZv
+demangle.test(char)
+#
+--format=dlang
+_D8demangle000000004testFaZv
+demangle.test(char)
+#
 # Unittests
 #
 --format=dlang