From 8ef443aba9ef765a1ca9db0248fb96df7c808795 Mon Sep 17 00:00:00 2001
From: ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 15 Dec 2003 23:29:31 +0000
Subject: 	* cp-demangle.c (d_print_function_type): Print the function 
 parameters with no modifiers. 	* testsuite/demangle-expected: Add test case.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74652 138bc75d-0d04-0410-961f-82ee72b054a4
---
 libiberty/ChangeLog                   | 4 ++++
 libiberty/cp-demangle.c               | 9 ++++++++-
 libiberty/testsuite/demangle-expected | 5 +++++
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index c33e83b3ef8..0a027a0c456 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,5 +1,9 @@
 2003-12-15  Ian Lance Taylor  <ian@wasabisystems.com>
 
+	* cp-demangle.c (d_print_function_type): Print the function
+	parameters with no modifiers.
+	* testsuite/demangle-expected: Add test case.
+
 	* cp-demangle.c (d_demangle): If DMGL_PARAMS is not set, don't
 	expect that we've read the entire string.
 	(is_ctor_or_dtor): Don't expect that we've read the entire
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 7a806dc44b2..f6c0543c8c3 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -3396,7 +3396,14 @@ d_print_function_type (dpi, dc, mods)
   d_append_char (dpi, '(');
 
   if (d_right (dc) != NULL)
-    d_print_comp (dpi, d_right (dc));
+    {
+      struct d_print_mod *hold_modifiers;
+
+      hold_modifiers = dpi->modifiers;
+      dpi->modifiers = NULL;
+      d_print_comp (dpi, d_right (dc));
+      dpi->modifiers = hold_modifiers;
+    }
 
   d_append_char (dpi, ')');
 
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index b39e2f4386b..7452338e1b3 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -2916,6 +2916,11 @@ void f<-1>()
 _ZNSdD0Ev
 std::basic_iostream<char, std::char_traits<char> >::~basic_iostream()
 #
+# Another case where we got member function qualifiers wrong.
+--format=gnu-v3
+_ZNK15nsBaseHashtableI15nsUint32HashKey8nsCOMPtrI4IFooEPS2_E13EnumerateReadEPF15PLDHashOperatorRKjS4_PvES9_
+nsBaseHashtable<nsUint32HashKey, nsCOMPtr<IFoo>, IFoo*>::EnumerateRead(PLDHashOperator (*)(unsigned int const&, IFoo*, void*), void*) const
+#
 # This caused an infinite loop.
 #
 # This is generated by an EDG compiler (kcc 4.0).  To demangle it
-- 
cgit v1.2.1