This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFA: Patch for new demangler

So naturally right after checking in the new demangler I read an
e-mail message with a mangled name which it fails on.

This patch fixes it.  I also added some new test cases to the
demangler testsuite, including the one which needs the following

OK to check in?


2003-11-21  Ian Lance Taylor  <>

	* cp-demangle.c (has_return_type): Skip qualifiers when checking
	whether we have a template.
	* testsuite/demangle-expected: Add four new tests.

Index: cp-demangle.c
RCS file: /cvs/gcc/gcc/libiberty/cp-demangle.c,v
retrieving revision 1.51
diff -u -p -r1.51 cp-demangle.c
--- cp-demangle.c	21 Nov 2003 03:27:58 -0000	1.51
+++ cp-demangle.c	21 Nov 2003 21:07:13 -0000
@@ -908,6 +908,11 @@ has_return_type (dc)
       return 0;
     case D_COMP_TEMPLATE:
       return ! is_ctor_dtor_or_conversion (d_left (dc));
+    case D_COMP_RESTRICT:
+    case D_COMP_VOLATILE:
+    case D_COMP_CONST:
+      return has_return_type (d_left (dc));
Index: testsuite/demangle-expected
RCS file: /cvs/gcc/gcc/libiberty/testsuite/demangle-expected,v
retrieving revision 1.18
diff -u -p -r1.18 demangle-expected
--- testsuite/demangle-expected	21 Nov 2003 20:12:22 -0000	1.18
+++ testsuite/demangle-expected	21 Nov 2003 21:07:15 -0000
@@ -2858,6 +2858,27 @@ global constructors keyed to _Z2fnv
 r(int (G::*)(), int (G::*)() const, G, int (H::*)(), int (G::*)(), what<G const>, what2<G const>, int (G::*)() const)
+# This is from the gdb testsuite gdb.cp/cplusfuncs.exp.
+hairyfunc5(int (*(*)(char*))(long))
+# This is from gcc PR 8861
+void f<1, 120>(A<(1) + (((int)((double)810000000000000000703DAD7A370C5)))>)
+# This is also from gcc PR 8861
+void f<1>(A<(1) + (((int)(-((float)3f800000))))>)
+# This is from a libstdc++ debug mode patch.
+void __gnu_debug::_Error_formatter::_M_format_word<unsigned long>(char*, int, char const*, unsigned long) const
 # This caused an infinite loop.
 # We still don't demangle this correctly, but at least we don't hang.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]