]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tinfo.cc (type_info::operator==): Test __name instead of name().
authorMarcus Shawcroft <marcus.shawcroft@arm.com>
Tue, 27 Sep 2011 06:03:58 +0000 (06:03 +0000)
committerJoey Ye <jye2@gcc.gnu.org>
Tue, 27 Sep 2011 06:03:58 +0000 (06:03 +0000)
2011-09-27  Marcus Shawcroft  <marcus.shawcroft@arm.com>

* libsupc++/tinfo.cc (type_info::operator==): Test __name instead
of name().

From-SVN: r179236

libstdc++-v3/ChangeLog
libstdc++-v3/libsupc++/tinfo.cc

index 140bdb1a5b652ee4bf2f4eecc30538b172e57488..a1b4af02c349d9c1f3a12731d54866401af7fee4 100644 (file)
@@ -1,3 +1,8 @@
+2011-09-27  Marcus Shawcroft  <marcus.shawcroft@arm.com>
+
+       * libsupc++/tinfo.cc (type_info::operator==): Test __name instead
+       of name().
+
 2011-09-26  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR libstdc++/50529
index d939a3fdab7cefc02d8f0908f8614f21f468a2bd..eba74dbdada5d8530fc8146adfd2420bb8461485 100644 (file)
@@ -41,8 +41,11 @@ operator== (const std::type_info& arg) const
 #if __GXX_MERGED_TYPEINFO_NAMES
   return name () == arg.name ();
 #else
+  /* The name() method will strip any leading '*' prefix. Therefore
+     take care to look at __name rather than name() when looking for
+     the "pointer" prefix.  */
   return (&arg == this)
-    || (name ()[0] != '*' && (__builtin_strcmp (name (), arg.name ()) == 0));
+    || (__name[0] != '*' && (__builtin_strcmp (name (), arg.name ()) == 0));
 #endif
 }