Hi!

Mangling of decltype(auto) has been added back in April 2013:
https://gcc.gnu.org/ml/gcc-patches/2013-04/msg01273.html
and matches the
https://mentorembedded.github.io/cxx-abi/abi.html#mangling
                 ::= Da # auto
                 ::= Dc # decltype(auto)
part, but the corresponding demangler change has never been added.

The following patch adds it.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2016-12-10  Jakub Jelinek  <ja...@redhat.com>

        PR c++/78761
        * cp-demangle.c (cplus_demangle_type): Demangle Dc as decltype(auto).
        * testsuite/demangle-expected: Add test for decltype(auto).

--- libiberty/cp-demangle.c.jj  2016-11-30 08:57:16.000000000 +0100
+++ libiberty/cp-demangle.c     2016-12-10 09:31:17.698046004 +0100
@@ -2590,7 +2590,11 @@ cplus_demangle_type (struct d_info *di)
          /* auto */
          ret = d_make_name (di, "auto", 4);
          break;
-         
+       case 'c':
+         /* decltype(auto) */
+         ret = d_make_name (di, "decltype(auto)", 14);
+         break;
+
        case 'f':
          /* 32-bit decimal floating point */
          ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[26]);
--- libiberty/testsuite/demangle-expected.jj    2016-11-16 07:13:50.000000000 
+0100
+++ libiberty/testsuite/demangle-expected       2016-12-10 09:39:44.277651914 
+0100
@@ -4200,6 +4200,9 @@ decltype (new auto({parm#1})) f<int>(int
 _Z1fIiERDaRKT_S1_
 auto& f<int>(int const&, int)
 --format=gnu-v3
+_Z1gIiEDcRKT_S0_
+decltype(auto) g<int>(int const&, int)
+--format=gnu-v3
 _Z1gILi1EEvR1AIXT_EER1BIXscbT_EE
 void g<1>(A<1>&, B<static_cast<bool>(1)>&)
 --format=gnu-v3

        Jakub

Reply via email to