summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorjlquinn <jlquinn@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-30 05:17:50 +0000
committerjlquinn <jlquinn@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-30 05:17:50 +0000
commit91084be03ab2a4fe18a388e9f7f015699b3a6ef5 (patch)
tree3e48079c89ef88e63d587c9282415e1ead2144f6 /libstdc++-v3
parentfe03d4d8ecf57e389d915b5b652d2e8d4ad884eb (diff)
downloadgcc-91084be03ab2a4fe18a388e9f7f015699b3a6ef5.tar.gz
2009-10-28 Jerry Quinn <jlquinn@optonline.net>
* mangle.c (mangle_type_string_for_rtti): Revert r149964. (needs_fake_anon): Likewise. (write_name): Likewise. (write_nested_name): Likewise. * cp-tree.h (mangle_type_string_for_rtti): Likewise. (get_anonymous_namespace): Likewise. * name-lookup.c (get_anonymous_namespace_name): Likewise. * rtti.c (tinfo_name): Insert '*' in front of private names. (tinfo_base_init): Use it. 2009-10-28 Jerry Quinn <jlquinn@optonline.net> * libsupc++/tinfo.cc (operator=(const type_info&)): Compare by pointer if name begins with '*'. * libsupc++/typeinfo (type_info::name()): Likewise. * libsupc++/tinfo2.cc (before): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153734 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog7
-rw-r--r--libstdc++-v3/libsupc++/tinfo.cc3
-rw-r--r--libstdc++-v3/libsupc++/tinfo2.cc3
-rw-r--r--libstdc++-v3/libsupc++/typeinfo9
4 files changed, 17 insertions, 5 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 402d7fb87e4..972a44d88a0 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,10 @@
+2009-10-28 Jerry Quinn <jlquinn@optonline.net>
+
+ * libsupc++/tinfo.cc (operator=(const type_info&)): Compare by
+ pointer if name begins with '*'.
+ * libsupc++/typeinfo (type_info::name()): Likewise.
+ * libsupc++/tinfo2.cc (before): Likewise.
+
2009-10-29 Paolo Carlini <paolo.carlini@oracle.com>
Douglas Gregor <doug.gregor@gmail.com>
diff --git a/libstdc++-v3/libsupc++/tinfo.cc b/libstdc++-v3/libsupc++/tinfo.cc
index 1ce6f8f46ab..d939a3fdab7 100644
--- a/libstdc++-v3/libsupc++/tinfo.cc
+++ b/libstdc++-v3/libsupc++/tinfo.cc
@@ -41,7 +41,8 @@ operator== (const std::type_info& arg) const
#if __GXX_MERGED_TYPEINFO_NAMES
return name () == arg.name ();
#else
- return (&arg == this) || (__builtin_strcmp (name (), arg.name ()) == 0);
+ return (&arg == this)
+ || (name ()[0] != '*' && (__builtin_strcmp (name (), arg.name ()) == 0));
#endif
}
diff --git a/libstdc++-v3/libsupc++/tinfo2.cc b/libstdc++-v3/libsupc++/tinfo2.cc
index 4b01037f3b9..0182c6cc0de 100644
--- a/libstdc++-v3/libsupc++/tinfo2.cc
+++ b/libstdc++-v3/libsupc++/tinfo2.cc
@@ -37,7 +37,8 @@ type_info::before (const type_info &arg) const
#if __GXX_MERGED_TYPEINFO_NAMES
return name () < arg.name ();
#else
- return __builtin_strcmp (name (), arg.name ()) < 0;
+ return (name ()[0] == '*') ? name () < arg.name ()
+ : __builtin_strcmp (name (), arg.name ()) < 0;
#endif
}
diff --git a/libstdc++-v3/libsupc++/typeinfo b/libstdc++-v3/libsupc++/typeinfo
index 4c470430def..f7f9d4e2cc2 100644
--- a/libstdc++-v3/libsupc++/typeinfo
+++ b/libstdc++-v3/libsupc++/typeinfo
@@ -94,7 +94,7 @@ namespace std
/** Returns an @e implementation-defined byte string; this is not
* portable between compilers! */
const char* name() const
- { return __name; }
+ { return __name[0] == '*' ? __name + 1 : __name; }
#if !__GXX_TYPEINFO_EQUALITY_INLINE
// In old abi, or when weak symbols are not supported, there can
@@ -110,12 +110,15 @@ namespace std
// we can run into cases where type_info names aren't merged,
// so we still need to do string comparison.
bool before(const type_info& __arg) const
- { return __builtin_strcmp (__name, __arg.__name) < 0; }
+ { return (__name[0] == '*' && __arg.__name[0] == '*')
+ ? __name < __arg.__name
+ : __builtin_strcmp (__name, __arg.__name) < 0; }
bool operator==(const type_info& __arg) const
{
return ((__name == __arg.__name)
- || __builtin_strcmp (__name, __arg.__name) == 0);
+ || (__name[0] != '*' &&
+ __builtin_strcmp (__name, __arg.__name) == 0));
}
#else
// On some targets we can rely on type_info's NTBS being unique,