From: Iain Buclaw Date: Sat, 16 May 2015 16:50:19 +0000 (+0000) Subject: d-demangle.c (dlang_template_args): Skip over specialized template parameters in... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ed4cdb8502c67b7cafa4d939a52d4ac6ac1db65d;p=gcc.git d-demangle.c (dlang_template_args): Skip over specialized template parameters in mangled symbol. libiberty/ChangeLog: 2015-05-16 Iain Buclaw * d-demangle.c (dlang_template_args): Skip over specialized template parameters in mangled symbol. * testsuite/d-demangle-expected: Add coverage and unittest for specialized template parameters. From-SVN: r223246 --- diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 110745df894..945551eb3a9 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,10 @@ +2015-05-16 Iain Buclaw + + * d-demangle.c (dlang_template_args): Skip over specialized template + parameters in mangled symbol. + * testsuite/d-demangle-expected: Add coverage and unittest for specialized + template parameters. + 2015-05-16 Iain Buclaw * d-demangle.c (dlang_type): Handle cent and ucent types. diff --git a/libiberty/d-demangle.c b/libiberty/d-demangle.c index 05f3a5e4b30..76051054dbc 100644 --- a/libiberty/d-demangle.c +++ b/libiberty/d-demangle.c @@ -1383,6 +1383,10 @@ dlang_template_args (string *decl, const char *mangled) if (n++) string_append (decl, ", "); + /* Skip over specialised template prefix. */ + if (*mangled == 'H') + mangled++; + switch (*mangled) { case 'S': /* Symbol parameter. */ diff --git a/libiberty/testsuite/d-demangle-expected b/libiberty/testsuite/d-demangle-expected index e3fd850862e..3182dc77bfb 100644 --- a/libiberty/testsuite/d-demangle-expected +++ b/libiberty/testsuite/d-demangle-expected @@ -630,6 +630,10 @@ _D8demangle19__T4testS6symbolTaZv demangle.test!(symbol, char) # --format=dlang +_D8demangle12__T4testHTaZv +demangle.test!(char) +# +--format=dlang _D8demangle13__T4testVPinZv demangle.test!(null) # @@ -1050,3 +1054,7 @@ test.main().local() --format=dlang _D3std6socket12InternetHost221__T13getHostNoSyncVAyaa96_0a09202020206175746f2078203d2068746f6e6c28706172616d293b0a09202020206175746f206865203d20676574686f73746279616464722826782c20342c206361737428696e74294164647265737346616d696c792e494e4554293b0a09TkZ13getHostNoSyncMFkZb std.socket.InternetHost.getHostNoSync!("\n\t auto x = htonl(param);\n\t auto he = gethostbyaddr(&x, 4, cast(int)AddressFamily.INET);\n\t", uint).getHostNoSync(uint) +# +--format=dlang +_D2gc6config13__T5parseHTfZ5parseFNbNiAxaKAxaKfZb +gc.config.parse!(float).parse(const(char)[], ref const(char)[], ref float)