]> gcc.gnu.org Git - gcc.git/commitdiff
re PR other/28797 (Problems with demangling (__cxa_demangle()))
authorIan Lance Taylor <ian@airs.com>
Sun, 27 Aug 2006 21:42:55 +0000 (21:42 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Sun, 27 Aug 2006 21:42:55 +0000 (21:42 +0000)
PR other/28797
* cp-demangle.c (d_pointer_to_member_type): Do add a substitution
for a qualified member which is not a function.
* testsuite/demangle-expected: Add test case.

From-SVN: r116493

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

index 745a2f4f9712de3ebb08b917456f713b1fddc534..27280a3274d966fac46e1f9d99f00ffb83f3b6ff 100644 (file)
@@ -1,3 +1,10 @@
+2006-08-27  Ian Lance Taylor  <ian@airs.com>
+
+       PR other/28797
+       * cp-demangle.c (d_pointer_to_member_type): Do add a substitution
+       for a qualified member which is not a function.
+       * testsuite/demangle-expected: Add test case.
+
 2006-07-27  Jan Hubicka  <jh@suse.cz>
 
        PR rtl-optimization/28071
index 109d533b524e4175f61b304caa84b1199ed3c7d9..c7ee8786d9225031832c205a223aa2b4af0d6218 100644 (file)
@@ -2081,13 +2081,22 @@ d_pointer_to_member_type (struct d_info *di)
      g++ does not work that way.  g++ treats only the CV-qualified
      member function as a substitution source.  FIXME.  So to work
      with g++, we need to pull off the CV-qualifiers here, in order to
-     avoid calling add_substitution() in cplus_demangle_type().  */
+     avoid calling add_substitution() in cplus_demangle_type().  But
+     for a CV-qualified member which is not a function, g++ does
+     follow the ABI, so we need to handle that case here by calling
+     d_add_substitution ourselves.  */
 
   pmem = d_cv_qualifiers (di, &mem, 1);
   if (pmem == NULL)
     return NULL;
   *pmem = cplus_demangle_type (di);
 
+  if (pmem != &mem && (*pmem)->type != DEMANGLE_COMPONENT_FUNCTION_TYPE)
+    {
+      if (! d_add_substitution (di, mem))
+       return NULL;
+    }
+
   return d_make_comp (di, DEMANGLE_COMPONENT_PTRMEM_TYPE, cl, mem);
 }
 
index fa2a2fed24586888d536e86fcbafdee892b924a5..4aaa3d639ec34896228a1b8c40c65d01d03459bb 100644 (file)
@@ -3805,3 +3805,9 @@ java::lang::Math::acos(double)double
 _Z4makeI7FactoryiET_IT0_Ev
 make<Factory, int>()Factory<int>
 make<Factory, int>
+#
+# From PR 28797
+--format=auto --no-params
+_Z1fM1AKiPKS1_
+f(int const A::*, int const A::* const*)
+f
This page took 0.078691 seconds and 5 git commands to generate.