libiberty: d-demangle: write distinguishable variadics on demangled symbol
Commit Message
Currently _D8demangle4testFYv and _D8demangle4testFXv report the same demangled
symbol and they are not the same. The official demangler reports
"demangle.test(, ...)", which is the distinguishable way to do it.
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
libiberty/ChangeLog:
* d-demangle.c (dlang_function_args): change Y variadic to always
report ", ...".
* testsuite/d-demangle-expected: change test for Y variadic and add a
missing test for X variadic.
---
libiberty/d-demangle.c | 4 +---
libiberty/testsuite/d-demangle-expected | 4 ++++
2 files changed, 5 insertions(+), 3 deletions(-)
@@ -690,9 +690,7 @@ dlang_function_args (string *decl, const char *mangled, struct dlang_info *info)
return mangled;
case 'Y': /* (variadic T t, ...) style. */
mangled++;
- if (n != 0)
- string_append (decl, ", ");
- string_append (decl, "...");
+ string_append (decl, ", ...");
return mangled;
case 'Z': /* Normal function. */
mangled++;
@@ -359,6 +359,10 @@ demangle.test(char, char, ...)
#
--format=dlang
_D8demangle4testFYv
+demangle.test(, ...)
+#
+--format=dlang
+_D8demangle4testFXv
demangle.test(...)
#
--format=dlang