diff options
author | kan <kan@FreeBSD.org> | 2007-08-14 02:49:11 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2007-08-14 02:49:11 +0000 |
commit | 6012218763eac328f0b776413bf0fda0032c6a3e (patch) | |
tree | d56f6a8737f66e915d38a8db688eb0d08bf6e32e /contrib/libstdc++/libsupc++ | |
parent | d2ff90cc580c62afb8528917c1c80ac49d9aaa01 (diff) | |
download | FreeBSD-src-6012218763eac328f0b776413bf0fda0032c6a3e.zip FreeBSD-src-6012218763eac328f0b776413bf0fda0032c6a3e.tar.gz |
GCC 4.2.1 release C++ standard library and runtime support code.
Diffstat (limited to 'contrib/libstdc++/libsupc++')
-rw-r--r-- | contrib/libstdc++/libsupc++/exception | 6 | ||||
-rw-r--r-- | contrib/libstdc++/libsupc++/new | 8 | ||||
-rw-r--r-- | contrib/libstdc++/libsupc++/typeinfo | 46 |
3 files changed, 37 insertions, 23 deletions
diff --git a/contrib/libstdc++/libsupc++/exception b/contrib/libstdc++/libsupc++/exception index 2046300..a7e2db7 100644 --- a/contrib/libstdc++/libsupc++/exception +++ b/contrib/libstdc++/libsupc++/exception @@ -58,6 +58,7 @@ namespace std public: exception() throw() { } virtual ~exception() throw(); + /** Returns a C-style character string describing the general cause * of the current error. */ virtual const char* what() const throw(); @@ -69,26 +70,31 @@ namespace std { public: bad_exception() throw() { } + // This declaration is not useless: // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 virtual ~bad_exception() throw(); + // See comment in eh_exception.cc. virtual const char* what() const throw(); }; /// If you write a replacement %terminate handler, it must be of this type. typedef void (*terminate_handler) (); + /// If you write a replacement %unexpected handler, it must be of this type. typedef void (*unexpected_handler) (); /// Takes a new handler function as an argument, returns the old function. terminate_handler set_terminate(terminate_handler) throw(); + /** The runtime will call this function if %exception handling must be * abandoned for any reason. It can also be called by the user. */ void terminate() __attribute__ ((__noreturn__)); /// Takes a new handler function as an argument, returns the old function. unexpected_handler set_unexpected(unexpected_handler) throw(); + /** The runtime will call this function if an %exception is thrown which * violates the function's %exception specification. */ void unexpected() __attribute__ ((__noreturn__)); diff --git a/contrib/libstdc++/libsupc++/new b/contrib/libstdc++/libsupc++/new index 26898bf..a821783 100644 --- a/contrib/libstdc++/libsupc++/new +++ b/contrib/libstdc++/libsupc++/new @@ -59,19 +59,25 @@ namespace std { public: bad_alloc() throw() { } + // This declaration is not useless: // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 virtual ~bad_alloc() throw(); + // See comment in eh_exception.cc. virtual const char* what() const throw(); }; struct nothrow_t { }; + extern const nothrow_t nothrow; + /** If you write your own error handler to be called by @c new, it must * be of this type. */ typedef void (*new_handler)(); - /// Takes a replacement handler as the argument, returns the previous handler. + + /// Takes a replacement handler as the argument, returns the + /// previous handler. new_handler set_new_handler(new_handler) throw(); } // namespace std 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(); }; |