summaryrefslogtreecommitdiffstats
path: root/contrib/libstdc++/libsupc++/typeinfo
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libstdc++/libsupc++/typeinfo')
-rw-r--r--contrib/libstdc++/libsupc++/typeinfo46
1 files changed, 24 insertions, 22 deletions
diff --git a/contrib/libstdc++/libsupc++/typeinfo b/contrib/libstdc++/libsupc++/typeinfo
index 1dde7f1..90ac18a 100644
--- a/contrib/libstdc++/libsupc++/typeinfo
+++ b/contrib/libstdc++/libsupc++/typeinfo
@@ -68,25 +68,12 @@ namespace std
class type_info
{
public:
- /** Destructor. Being the first non-inline virtual function, this
+ /** Destructor first. Being the first non-inline virtual function, this
* controls in which translation unit the vtable is emitted. The
* compiler makes use of that information to know where to emit
* the runtime-mandated type_info structures in the new-abi. */
virtual ~type_info();
- private:
- /// Assigning type_info is not supported. Made private.
- type_info& operator=(const type_info&);
- type_info(const type_info&);
-
- protected:
- const char *__name;
-
- protected:
- explicit type_info(const char *__n): __name(__n) { }
-
- public:
- // the public interface
/** Returns an @e implementation-defined byte string; this is not
* portable between compilers! */
const char* name() const
@@ -94,6 +81,7 @@ namespace std
#if !__GXX_MERGED_TYPEINFO_NAMES
bool before(const type_info& __arg) const;
+
// In old abi, or when weak symbols are not supported, there can
// be multiple instances of a type_info object for one
// type. Uniqueness must use the _name value, not object address.
@@ -105,19 +93,13 @@ namespace std
// and therefore address comparisons are sufficient.
bool before(const type_info& __arg) const
{ return __name < __arg.__name; }
+
bool operator==(const type_info& __arg) const
{ return __name == __arg.__name; }
#endif
bool operator!=(const type_info& __arg) const
{ return !operator==(__arg); }
- // the internal interface
- public:
- // return true if this is a pointer type of some kind
- virtual bool __is_pointer_p() const;
- // return true if this is a function type
- virtual bool __is_function_p() const;
-
// Try and catch a thrown type. Store an adjusted pointer to the
// caught type in THR_OBJ. If THR_TYPE is not a pointer type, then
// THR_OBJ points to the thrown object. If THR_TYPE is a pointer
@@ -127,9 +109,25 @@ namespace std
virtual bool __do_catch(const type_info *__thr_type, void **__thr_obj,
unsigned __outer) const;
- // internally used during catch matching
+ // Internally used during catch matching
virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target,
void **__obj_ptr) const;
+
+ // Return true if this is a pointer type of some kind
+ virtual bool __is_pointer_p() const;
+
+ // Return true if this is a function type
+ virtual bool __is_function_p() const;
+
+ protected:
+ const char *__name;
+
+ explicit type_info(const char *__n): __name(__n) { }
+
+ private:
+ /// Assigning type_info is not supported.
+ type_info& operator=(const type_info&);
+ type_info(const type_info&);
};
/**
@@ -141,9 +139,11 @@ namespace std
{
public:
bad_cast() throw() { }
+
// This declaration is not useless:
// http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
virtual ~bad_cast() throw();
+
// See comment in eh_exception.cc.
virtual const char* what() const throw();
};
@@ -153,9 +153,11 @@ namespace std
{
public:
bad_typeid () throw() { }
+
// This declaration is not useless:
// http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
virtual ~bad_typeid() throw();
+
// See comment in eh_exception.cc.
virtual const char* what() const throw();
};
OpenPOWER on IntegriCloud