aboutsummaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2010-11-13 01:21:12 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2010-11-13 01:21:12 +0000
commit759fe2404dd075257782f397bf84399e37925e4b (patch)
tree950bf5257c49674807126f428527ee5d594c2dba /libiberty
parent3c87e428b0a0a16d8dded98e3689da882c53be35 (diff)
downloadgcc-759fe2404dd075257782f397bf84399e37925e4b.zip
gcc-759fe2404dd075257782f397bf84399e37925e4b.tar.gz
gcc-759fe2404dd075257782f397bf84399e37925e4b.tar.bz2
re PR other/46332 (__cxa_demangle yields excess parentheses for function types)
libiberty/: PR other/46332 * cp-demangle.c (d_print_function_type): Don't print parentheses if there are no modifiers to print. * testsuite/demangle-expected: Tweak one test case, add another. libstdc++/: * testsuite/abi/demangle/abi_examples/14.cc (main): Change expected demangling. From-SVN: r166695
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog7
-rw-r--r--libiberty/cp-demangle.c6
-rw-r--r--libiberty/testsuite/demangle-expected9
3 files changed, 14 insertions, 8 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 62c60bd..8cd4a28 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,10 @@
+2010-11-12 Ian Lance Taylor <iant@google.com>
+
+ PR other/46332
+ * cp-demangle.c (d_print_function_type): Don't print parentheses
+ if there are no modifiers to print.
+ * testsuite/demangle-expected: Tweak one test case, add another.
+
2010-11-04 Richard Henderson <rth@redhat.com>
* configure.ac (AC_CHECK_HEADERS): Add process.h.
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 39c8cc0..8b0b825 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -4546,20 +4546,17 @@ d_print_function_type (struct d_print_info *dpi,
struct d_print_mod *mods)
{
int need_paren;
- int saw_mod;
int need_space;
struct d_print_mod *p;
struct d_print_mod *hold_modifiers;
need_paren = 0;
- saw_mod = 0;
need_space = 0;
for (p = mods; p != NULL; p = p->next)
{
if (p->printed)
break;
- saw_mod = 1;
switch (p->mod->type)
{
case DEMANGLE_COMPONENT_POINTER:
@@ -4588,9 +4585,6 @@ d_print_function_type (struct d_print_info *dpi,
break;
}
- if (d_left (dc) != NULL && ! saw_mod)
- need_paren = 1;
-
if (need_paren)
{
if (! need_space)
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 0507ce8..5b15445 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -3325,8 +3325,13 @@ first<Duo>
#
--format=gnu-v3 --no-params
_Z3fooIiFvdEiEvv
-void foo<int, void ()(double), int>()
-foo<int, void ()(double), int>
+void foo<int, void (double), int>()
+foo<int, void (double), int>
+#
+--format=gnu-v3 --no-params
+_Z1fIFvvEEvv
+void f<void ()>()
+f<void ()>
#
--format=gnu-v3 --no-params
_ZN1N1fE