+2009-04-18 Jan Hubicka <jh@suse.cz>
+
+ * src/condition_variable.cc (condition_variable,
+ condition_variable_any constructors): Mark throw()
+ * src/hash.cc (operator() for long double, string, and wstring): Mark
+ throw ().
+ * src/strstream.cc (strstreambuf constructors, freeze, str, pcount,
+ _M_setup, rdbuf, str): Mark throw ().
+ * src/chrono.cc (new): Mark throw ().
+ * include/std/system_error (system_category, generic_category): Mark
+ throw () and const.
+ * include/std/chrono (now): Mark throw ().
+ * include/std/condition_variable (condition_variable,
+ ~condition_variable, condition_variable_any,
+ ~condition_variable_any): Mark throw ().
+ * include/std/mutex (mutex): Mark throw ().
+ * include/bits/stl_list.h (swap, transfer, reverse, hook, unhook): Mark
+ throw.
+ * include/bits/functional_hash.h (operator() on size_t): Mark pure and throw ().
+ * include/bits/locale_facets.tcc (__verify_grouping): Mark pure.
+ * include/bits/locale_classes.h (_S_initialize_once,
+ _S_clone_c_locale): Mark throw ().
+ (_S_get_c_name): Mark const and throw ().
+ (_M_id, _M_compare, _M_transform, _M_compare, _M_transform): Mark throw ().
+ * include/bits/locale_facets.h (__convert_to_v explicit instances):
+ Mark throw ().
+ (_M_convert_to_wmask, _M_initialize_ctype, _S_format_float): Mark throw ().
+ * include/bits/ios_base.h (_M_dispose_callbacks, _M_init, imbue,
+ ios_base): Mark throw ()
+ * include/bits/locale_facets_nonio.h (_M_put): Mark throw.
+ * include/backward/strstream (strstreambuf constructors): Mark throw ().
+ (str, freeze, _M_setupf): Mark throw ().
+ (pcount): Mark pure and throw ().
+ (rdbuf): Mark const and throw ().
+
2009-04-18 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/39802
explicit strstreambuf(streamsize __initial_capacity = 0);
strstreambuf(void* (*__alloc)(size_t), void (*__free)(void*));
- strstreambuf(char* __get, streamsize __n, char* __put = 0);
- strstreambuf(signed char* __get, streamsize __n, signed char* __put = 0);
- strstreambuf(unsigned char* __get, streamsize __n, unsigned char* __put=0);
+ strstreambuf(char* __get, streamsize __n, char* __put = 0) throw ();
+ strstreambuf(signed char* __get, streamsize __n, signed char* __put = 0) throw ();
+ strstreambuf(unsigned char* __get, streamsize __n, unsigned char* __put=0) throw ();
- strstreambuf(const char* __get, streamsize __n);
- strstreambuf(const signed char* __get, streamsize __n);
- strstreambuf(const unsigned char* __get, streamsize __n);
+ strstreambuf(const char* __get, streamsize __n) throw ();
+ strstreambuf(const signed char* __get, streamsize __n) throw ();
+ strstreambuf(const unsigned char* __get, streamsize __n) throw ();
virtual ~strstreambuf();
public:
- void freeze(bool = true);
- char* str();
- int pcount() const;
+ void freeze(bool = true) throw ();
+ char* str() throw ();
+ _GLIBCXX_PURE int pcount() const throw ();
protected:
virtual int_type overflow(int_type __c = _Traits::eof());
void _M_free(char*);
// Helper function used in constructors.
- void _M_setup(char* __get, char* __put, streamsize __n);
+ void _M_setup(char* __get, char* __put, streamsize __n) throw ();
private:
// Data members.
istrstream(const char*, streamsize);
virtual ~istrstream();
- strstreambuf* rdbuf() const;
- char* str();
+ _GLIBCXX_CONST strstreambuf* rdbuf() const throw ();
+ char* str() throw ();
private:
strstreambuf _M_buf;
ostrstream(char*, int, ios_base::openmode = ios_base::out);
virtual ~ostrstream();
- strstreambuf* rdbuf() const;
- void freeze(bool = true);
- char* str();
- int pcount() const;
+ _GLIBCXX_CONST strstreambuf* rdbuf() const throw ();
+ void freeze(bool = true) throw();
+ char* str() throw ();
+ _GLIBCXX_PURE int pcount() const throw ();
private:
strstreambuf _M_buf;
strstream(char*, int, ios_base::openmode = ios_base::in | ios_base::out);
virtual ~strstream();
- strstreambuf* rdbuf() const;
- void freeze(bool = true);
- int pcount() const;
- char* str();
+ _GLIBCXX_CONST strstreambuf* rdbuf() const throw ();
+ void freeze(bool = true) throw ();
+ _GLIBCXX_PURE int pcount() const throw ();
+ char* str() throw ();
private:
strstreambuf _M_buf;
# define _GLIBCXX_NORETURN __attribute__ ((__noreturn__))
#endif
+#ifndef _GLIBCXX_NOTHROW
+# ifdef __cplusplus
+# define _GLIBCXX_NOTHROW throw()
+# else
+# define _GLIBCXX_NOTHROW __attribute__((nothrow))
+# endif
+#endif
+
// End of prewritten config; the discovered settings follow.
struct error_code;
template<>
- size_t
- hash<error_code>::operator()(error_code) const;
+ _GLIBCXX_PURE size_t
+ hash<error_code>::operator()(error_code) const throw ();
}
#endif // _FUNCTIONAL_HASH_H
_M_call_callbacks(event __ev) throw();
void
- _M_dispose_callbacks(void);
+ _M_dispose_callbacks(void) throw();
// 27.4.2.5 Members for iword/pword storage
struct _Words
locale _M_ios_locale;
void
- _M_init();
+ _M_init() throw ();
public:
* with imbue_event.
*/
locale
- imbue(const locale& __loc);
+ imbue(const locale& __loc) throw ();
/**
* @brief Locale access
virtual ~ios_base();
protected:
- ios_base();
+ ios_base() throw ();
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 50. Copy constructor and assignment operator of ios_base
_S_initialize();
static void
- _S_initialize_once();
+ _S_initialize_once() throw ();
static category
_S_normalize_category(category);
__c_locale __old = 0);
static __c_locale
- _S_clone_c_locale(__c_locale& __cloc);
+ _S_clone_c_locale(__c_locale& __cloc) throw ();
static void
_S_destroy_c_locale(__c_locale& __cloc);
static __c_locale
_S_get_c_locale();
- static const char*
- _S_get_c_name();
+ _GLIBCXX_CONST static const char*
+ _S_get_c_name() throw ();
private:
void
id() { }
size_t
- _M_id() const;
+ _M_id() const throw ();
};
// Used to abstract out _CharT bits in virtual member functions, below.
int
- _M_compare(const _CharT*, const _CharT*) const;
+ _M_compare(const _CharT*, const _CharT*) const throw ();
size_t
- _M_transform(_CharT*, const _CharT*, size_t) const;
+ _M_transform(_CharT*, const _CharT*, size_t) const throw ();
protected:
/// Destructor.
// Specializations.
template<>
int
- collate<char>::_M_compare(const char*, const char*) const;
+ collate<char>::_M_compare(const char*, const char*) const throw ();
template<>
size_t
- collate<char>::_M_transform(char*, const char*, size_t) const;
+ collate<char>::_M_transform(char*, const char*, size_t) const throw ();
#ifdef _GLIBCXX_USE_WCHAR_T
template<>
int
- collate<wchar_t>::_M_compare(const wchar_t*, const wchar_t*) const;
+ collate<wchar_t>::_M_compare(const wchar_t*, const wchar_t*) const throw ();
template<>
size_t
- collate<wchar_t>::_M_transform(wchar_t*, const wchar_t*, size_t) const;
+ collate<wchar_t>::_M_transform(wchar_t*, const wchar_t*, size_t) const throw ();
#endif
/// class collate_byname [22.2.4.2].
// Generic version does nothing.
template<typename _CharT>
int
- collate<_CharT>::_M_compare(const _CharT*, const _CharT*) const
+ collate<_CharT>::_M_compare(const _CharT*, const _CharT*) const throw ()
{ return 0; }
// Generic version does nothing.
template<typename _CharT>
size_t
- collate<_CharT>::_M_transform(_CharT*, const _CharT*, size_t) const
+ collate<_CharT>::_M_transform(_CharT*, const _CharT*, size_t) const throw ()
{ return 0; }
template<typename _CharT>
template<>
void
__convert_to_v(const char*, float&, ios_base::iostate&,
- const __c_locale&);
+ const __c_locale&) throw ();
template<>
void
__convert_to_v(const char*, double&, ios_base::iostate&,
- const __c_locale&);
+ const __c_locale&) throw ();
template<>
void
__convert_to_v(const char*, long double&, ios_base::iostate&,
- const __c_locale&);
+ const __c_locale&) throw ();
// NB: __pad is a struct, rather than a function, so it can be
// partially-specialized.
protected:
__wmask_type
- _M_convert_to_wmask(const mask __m) const;
+ _M_convert_to_wmask(const mask __m) const throw ();
/// Destructor
virtual
// For use at construction time only.
void
- _M_initialize_ctype();
+ _M_initialize_ctype() throw ();
};
#endif //_GLIBCXX_USE_WCHAR_T
// num_put
// Construct and return valid scanf format for floating point types.
static void
- _S_format_float(const ios_base& __io, char* __fptr, char __mod);
+ _S_format_float(const ios_base& __io, char* __fptr, char __mod) throw ();
};
template<typename _CharT>
// 1,222,444 == __grouping_tmp of "\1\3\3"
// __grouping is parsed R to L
// 1,222,444 == __grouping of "\3" == "\3\3\3"
- bool
+ _GLIBCXX_PURE bool
__verify_grouping(const char* __grouping, size_t __grouping_size,
- const string& __grouping_tmp);
+ const string& __grouping_tmp) throw ();
_GLIBCXX_BEGIN_LDBL_NAMESPACE
// value of strftime/wcsftime.
void
_M_put(_CharT* __s, size_t __maxlen, const _CharT* __format,
- const tm* __tm) const;
+ const tm* __tm) const throw ();
void
_M_date_formats(const _CharT** __date) const
template<>
void
- __timepunct<char>::_M_put(char*, size_t, const char*, const tm*) const;
+ __timepunct<char>::_M_put(char*, size_t, const char*, const tm*) const throw ();
#ifdef _GLIBCXX_USE_WCHAR_T
template<>
template<>
void
__timepunct<wchar_t>::_M_put(wchar_t*, size_t, const wchar_t*,
- const tm*) const;
+ const tm*) const throw ();
#endif
_GLIBCXX_END_NAMESPACE
// Construct and return valid pattern consisting of some combination of:
// space none symbol sign value
- static pattern
- _S_construct_pattern(char __precedes, char __space, char __posn);
+ _GLIBCXX_CONST static pattern
+ _S_construct_pattern(char __precedes, char __space, char __posn) throw ();
};
template<typename _CharT, bool _Intl>
_List_node_base* _M_prev;
static void
- swap(_List_node_base& __x, _List_node_base& __y);
+ swap(_List_node_base& __x, _List_node_base& __y) throw ();
void
transfer(_List_node_base * const __first,
- _List_node_base * const __last);
+ _List_node_base * const __last) throw ();
void
- reverse();
+ reverse() throw ();
void
- hook(_List_node_base * const __position);
+ hook(_List_node_base * const __position) throw ();
void
- unhook();
+ unhook() throw ();
};
/// An actual node in the %list.
// Accessor functions for base atomic_flag type.
bool
- atomic_flag_test_and_set_explicit(volatile __atomic_flag_base*, memory_order) throw ();
+ atomic_flag_test_and_set_explicit(volatile __atomic_flag_base*, memory_order) _GLIBCXX_NOTHROW;
inline bool
atomic_flag_test_and_set(volatile __atomic_flag_base* __a)
{ return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); }
void
- atomic_flag_clear_explicit(volatile __atomic_flag_base*, memory_order) throw ();
+ atomic_flag_clear_explicit(volatile __atomic_flag_base*, memory_order) _GLIBCXX_NOTHROW;
inline void
atomic_flag_clear(volatile __atomic_flag_base* __a)
{ atomic_flag_clear_explicit(__a, memory_order_seq_cst); }
void
- __atomic_flag_wait_explicit(volatile __atomic_flag_base*, memory_order) throw ();
+ __atomic_flag_wait_explicit(volatile __atomic_flag_base*, memory_order) _GLIBCXX_NOTHROW;
_GLIBCXX_CONST volatile __atomic_flag_base*
__atomic_flag_for_address(const volatile void* __z) throw ();
static const bool is_monotonic = false;
static time_point
- now();
+ now() throw ();
// Map to C API
static std::time_t
public:
typedef __native_type* native_handle_type;
- condition_variable();
- ~condition_variable();
+ condition_variable() throw ();
+ ~condition_variable() throw ();
condition_variable(const condition_variable&) = delete;
condition_variable& operator=(const condition_variable&) = delete;
public:
typedef __native_type* native_handle_type;
- condition_variable_any();
- ~condition_variable_any();
+ condition_variable_any() throw ();
+ ~condition_variable_any() throw ();
condition_variable_any(const condition_variable_any&) = delete;
condition_variable_any& operator=(const condition_variable_any&) = delete;
{
public:
virtual const char*
- what() const throw();
+ _GLIBCXX_CONST what() const throw();
};
/// @brief Scoped lock idiom.
};
// DR 890.
- const error_category& system_category();
- const error_category& generic_category();
+ _GLIBCXX_CONST const error_category& system_category() throw ();
+ _GLIBCXX_CONST const error_category& generic_category() throw ();
/// error_code
// Implementation-specific error identification
const bool system_clock::is_monotonic;
system_clock::time_point
- system_clock::now()
+ system_clock::now() throw ()
{
#ifdef _GLIBCXX_USE_CLOCK_REALTIME
timespec tp;
namespace std
{
- condition_variable::condition_variable()
+ condition_variable::condition_variable() throw ()
{
#ifdef __GTHREAD_COND_INIT
__native_type __tmp = __GTHREAD_COND_INIT;
#endif
}
- condition_variable::~condition_variable()
+ condition_variable::~condition_variable() throw ()
{
// XXX no thread blocked
/* int __e = */ __gthread_cond_destroy(&_M_cond);
__throw_system_error(__e);
}
- condition_variable_any::condition_variable_any()
+ condition_variable_any::condition_variable_any() throw ()
{
#ifdef __GTHREAD_COND_INIT
__native_type __tmp = __GTHREAD_COND_INIT;
#endif
}
- condition_variable_any::~condition_variable_any()
+ condition_variable_any::~condition_variable_any() throw ()
{
__gthread_cond_destroy(&_M_cond);
}
// 10 bytes -> 12 bytes) and resort to frexp.
template<>
size_t
- hash<long double>::operator()(long double __val) const
+ hash<long double>::operator()(long double __val) const throw ()
{
size_t __result = 0;
#ifndef _GLIBCXX_LONG_DOUBLE_COMPAT_IMPL
template<>
size_t
- hash<string>::operator()(string __s) const
+ hash<string>::operator()(string __s) const throw ()
{ return _Fnv_hash<>::hash(__s.data(), __s.length()); }
template<>
size_t
- hash<const string&>::operator()(const string& __s) const
+ hash<const string&>::operator()(const string& __s) const throw ()
{ return _Fnv_hash<>::hash(__s.data(), __s.length()); }
#ifdef _GLIBCXX_USE_WCHAR_T
template<>
size_t
- hash<wstring>::operator()(wstring __s) const
+ hash<wstring>::operator()(wstring __s) const throw ()
{
const char* __p = reinterpret_cast<const char*>(__s.data());
return _Fnv_hash<>::hash(__p, __s.length() * sizeof(wchar_t));
template<>
size_t
- hash<const wstring&>::operator()(const wstring& __s) const
+ hash<const wstring&>::operator()(const wstring& __s) const throw ()
{
const char* __p = reinterpret_cast<const char*>(__s.data());
return _Fnv_hash<>::hash(__p, __s.length() * sizeof(wchar_t));
}
}
- strstreambuf::strstreambuf(char* get, streamsize n, char* put)
+ strstreambuf::strstreambuf(char* get, streamsize n, char* put) throw ()
: _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false),
_M_frozen(false), _M_constant(false)
{ _M_setup(get, put, n); }
- strstreambuf::strstreambuf(signed char* get, streamsize n, signed char* put)
+ strstreambuf::strstreambuf(signed char* get, streamsize n, signed char* put) throw ()
: _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false),
_M_frozen(false), _M_constant(false)
{ _M_setup(reinterpret_cast<char*>(get), reinterpret_cast<char*>(put), n); }
strstreambuf::strstreambuf(unsigned char* get, streamsize n,
- unsigned char* put)
+ unsigned char* put) throw ()
: _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false),
_M_frozen(false), _M_constant(false)
{ _M_setup(reinterpret_cast<char*>(get), reinterpret_cast<char*>(put), n); }
- strstreambuf::strstreambuf(const char* get, streamsize n)
+ strstreambuf::strstreambuf(const char* get, streamsize n) throw ()
: _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false),
_M_frozen(false), _M_constant(true)
{ _M_setup(const_cast<char*>(get), 0, n); }
- strstreambuf::strstreambuf(const signed char* get, streamsize n)
+ strstreambuf::strstreambuf(const signed char* get, streamsize n) throw ()
: _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false),
_M_frozen(false), _M_constant(true)
{ _M_setup(reinterpret_cast<char*>(const_cast<signed char*>(get)), 0, n); }
- strstreambuf::strstreambuf(const unsigned char* get, streamsize n)
+ strstreambuf::strstreambuf(const unsigned char* get, streamsize n) throw ()
: _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false),
_M_frozen(false), _M_constant(true)
{ _M_setup(reinterpret_cast<char*>(const_cast<unsigned char*>(get)), 0, n); }
}
void
- strstreambuf::freeze(bool frozenflag)
+ strstreambuf::freeze(bool frozenflag) throw ()
{
if (_M_dynamic)
_M_frozen = frozenflag;
}
char*
- strstreambuf::str()
+ strstreambuf::str() throw ()
{
freeze(true);
return eback();
}
int
- strstreambuf::pcount() const
+ strstreambuf::pcount() const throw ()
{ return pptr() ? pptr() - pbase() : 0; }
strstreambuf::int_type
}
void
- strstreambuf::_M_setup(char* get, char* put, streamsize n)
+ strstreambuf::_M_setup(char* get, char* put, streamsize n) throw ()
{
if (get)
{
istrstream::~istrstream() { }
strstreambuf*
- istrstream::rdbuf() const
+ istrstream::rdbuf() const throw ()
{ return const_cast<strstreambuf*>(&_M_buf); }
char*
- istrstream::str()
+ istrstream::str() throw ()
{ return _M_buf.str(); }
ostrstream::ostrstream()
ostrstream::~ostrstream() {}
strstreambuf*
- ostrstream::rdbuf() const
+ ostrstream::rdbuf() const throw ()
{ return const_cast<strstreambuf*>(&_M_buf); }
void
- ostrstream::freeze(bool freezeflag)
+ ostrstream::freeze(bool freezeflag) throw ()
{ _M_buf.freeze(freezeflag); }
char*
- ostrstream::str()
+ ostrstream::str() throw ()
{ return _M_buf.str(); }
int
- ostrstream::pcount() const
+ ostrstream::pcount() const throw ()
{ return _M_buf.pcount(); }
strstream::strstream()
strstream::~strstream() { }
strstreambuf*
- strstream::rdbuf() const
+ strstream::rdbuf() const throw ()
{ return const_cast<strstreambuf*>(&_M_buf); }
void
- strstream::freeze(bool freezeflag)
+ strstream::freeze(bool freezeflag) throw ()
{ _M_buf.freeze(freezeflag); }
int
- strstream::pcount() const
+ strstream::pcount() const throw ()
{ return _M_buf.pcount(); }
char*
- strstream::str()
+ strstream::str() throw ()
{ return _M_buf.str(); }
_GLIBCXX_END_NAMESPACE