Blame SOURCES/gcc32-cxa_demangle-ambiguity.patch

4ac4fd
2005-02-13  Jason Merrill  <jason@redhat.com>
4ac4fd
4ac4fd
	* cp-demangle.c (__cxa_demangle): Change resolution of ambiguous
4ac4fd
	arguments.
4ac4fd
4ac4fd
2005-02-15  Jakub Jelinek  <jakub@redhat.com>
4ac4fd
4ac4fd
	PR libstdc++/19946
4ac4fd
	* testsuite/demangle/abi_examples/01.cc (main): Adjust for 2005-02-13
4ac4fd
	demangler change.
4ac4fd
	* testsuite/demangle/abi_examples/02.cc (main): Likewise.
4ac4fd
4ac4fd
--- libiberty/cp-demangle.c	24 Nov 2004 02:19:09 -0000	1.75
4ac4fd
+++ libiberty/cp-demangle.c	13 Feb 2005 06:58:20 -0000	1.76
4ac4fd
@@ -4047,21 +4047,6 @@ __cxa_demangle (mangled_name, output_buf
4ac4fd
       return NULL;
4ac4fd
     }
4ac4fd
 
4ac4fd
-  /* The specification for __cxa_demangle() is that if the mangled
4ac4fd
-     name could be either an extern "C" identifier, or an internal
4ac4fd
-     built-in type name, then we resolve it as the identifier.  All
4ac4fd
-     internal built-in type names are a single lower case character.
4ac4fd
-     Frankly, this simplistic disambiguation doesn't make sense to me,
4ac4fd
-     but it is documented, so we implement it here.  */
4ac4fd
-  if (IS_LOWER (mangled_name[0])
4ac4fd
-      && mangled_name[1] == '\0'
4ac4fd
-      && cplus_demangle_builtin_types[mangled_name[0] - 'a'].name != NULL)
4ac4fd
-    {
4ac4fd
-      if (status != NULL)
4ac4fd
-	*status = -2;
4ac4fd
-      return NULL;
4ac4fd
-    }
4ac4fd
-
4ac4fd
   demangled = d_demangle (mangled_name, DMGL_PARAMS | DMGL_TYPES, &alc;;
4ac4fd
 
4ac4fd
   if (demangled == NULL)
4ac4fd
--- libstdc++-v3/testsuite/demangle/abi_examples/01.cc.jj	2004-03-09 16:09:24.000000000 +0100
4ac4fd
+++ libstdc++-v3/testsuite/demangle/abi_examples/01.cc	2005-02-14 09:05:09.383834357 +0100
4ac4fd
@@ -1,6 +1,6 @@
4ac4fd
 // 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
4ac4fd
 
4ac4fd
-// Copyright (C) 2003 Free Software Foundation, Inc.
4ac4fd
+// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
4ac4fd
 //
4ac4fd
 // This file is part of the GNU ISO C++ Library.  This library is free
4ac4fd
 // software; you can redistribute it and/or modify it under the
4ac4fd
@@ -31,7 +31,9 @@ int main()
4ac4fd
   // extern "C" function 
4ac4fd
   // extern "C" float f(void) { };
4ac4fd
   // T f
4ac4fd
-  verify_demangle("f", "error code = -2: invalid mangled name");
4ac4fd
+  // f is ambiguous between "C" external name and internal built-in type
4ac4fd
+  // name.  The ambiguity is resolved to the built-in type name.
4ac4fd
+  verify_demangle("f", "float");
4ac4fd
 
4ac4fd
   return 0;
4ac4fd
 }
4ac4fd
--- libstdc++-v3/testsuite/demangle/abi_examples/02.cc.jj	2004-03-09 16:09:24.000000000 +0100
4ac4fd
+++ libstdc++-v3/testsuite/demangle/abi_examples/02.cc	2005-02-14 09:05:59.661857808 +0100
4ac4fd
@@ -1,6 +1,6 @@
4ac4fd
 // 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
4ac4fd
 
4ac4fd
-// Copyright (C) 2003 Free Software Foundation, Inc.
4ac4fd
+// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
4ac4fd
 //
4ac4fd
 // This file is part of the GNU ISO C++ Library.  This library is free
4ac4fd
 // software; you can redistribute it and/or modify it under the
4ac4fd
@@ -31,7 +31,9 @@ int main()
4ac4fd
   // or variable "f" 
4ac4fd
   // int f;
4ac4fd
   // B f
4ac4fd
-  verify_demangle("f", "error code = -2: invalid mangled name");
4ac4fd
+  // f is ambiguous between variable external name and internal built-in type
4ac4fd
+  // name.  The ambiguity is resolved to the built-in type name.
4ac4fd
+  verify_demangle("f", "float");
4ac4fd
 
4ac4fd
   return 0;
4ac4fd
 }