cp-demangle.c (d_print_comp): Suppress d_print_mod for DMGL_RET_POSTFIX.
authorJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 13 Jun 2011 22:34:19 +0000 (22:34 +0000)
committerJan Kratochvil <jkratoch@gcc.gnu.org>
Mon, 13 Jun 2011 22:34:19 +0000 (22:34 +0000)
libiberty/
* cp-demangle.c (d_print_comp) <DEMANGLE_COMPONENT_FUNCTION_TYPE>:
Suppress d_print_mod for DMGL_RET_POSTFIX.
* testsuite/demangle-expected: New testcases for --ret-postfix.

From-SVN: r175001

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

index 8e1fa521db61f44c1b2f72fd9eda867ef2767e49..0b8977c4e170138b17458e546c9acd334b8f8d0d 100644 (file)
@@ -1,3 +1,9 @@
+2011-06-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * cp-demangle.c (d_print_comp) <DEMANGLE_COMPONENT_FUNCTION_TYPE>:
+       Suppress d_print_mod for DMGL_RET_POSTFIX.
+       * testsuite/demangle-expected: New testcases for --ret-postfix.
+
 2011-06-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * cp-demangle.c (d_print_comp) <DEMANGLE_COMPONENT_FUNCTION_TYPE>: Do
index da6d7979f2c44348e38f9523cc17a3d361400f6a..3fc5266015334cca42d2dfd454053f331b968bea 100644 (file)
@@ -3922,7 +3922,10 @@ d_print_comp (struct d_print_info *dpi, int options,
                                 dc, dpi->modifiers);
 
        /* Print return type if present */
-       if (d_left (dc) != NULL && (options & DMGL_RET_DROP) == 0)
+       if (d_left (dc) != NULL && (options & DMGL_RET_POSTFIX) != 0)
+         d_print_comp (dpi, options & ~(DMGL_RET_POSTFIX | DMGL_RET_DROP),
+                       d_left (dc));
+       else if (d_left (dc) != NULL && (options & DMGL_RET_DROP) == 0)
          {
            struct d_print_mod dpm;
 
index 63a3e24ba4193799b92282a15054bc3abb2c6081..c94eb3c00f51a15b18e1150d40668b05f430a925 100644 (file)
@@ -3968,6 +3968,15 @@ outer(short (*)(int), long)
 --format=gnu-v3
 _Z6outer2IsEPFilES1_
 int (*outer2<short>(int (*)(long)))(long)
+--format=gnu-v3 --ret-postfix
+_Z5outerIsEcPFilE
+outer<short>(int (*)(long))char
+--format=gnu-v3 --ret-postfix
+_Z5outerPFsiEl
+outer(short (*)(int), long)
+--format=gnu-v3 --ret-postfix
+_Z6outer2IsEPFilES1_
+outer2<short>(int (*)(long))int (*)(long)
 --format=gnu-v3 --ret-drop
 _Z5outerIsEcPFilE
 outer<short>(int (*)(long))