hintonda created this revision. hintonda added reviewers: rsmith, howard.hinnant, logan. hintonda added a subscriber: cfe-commits.
Fix -Wdeprecated warning for throw() specs and implicit copy ctor's and assignmen oper's. http://reviews.llvm.org/D18217 Files: include/__bit_reference include/__sso_allocator include/codecvt include/exception include/future include/ios include/memory include/new include/regex include/stdexcept include/system_error include/typeinfo src/ios.cpp src/regex.cpp
Index: src/regex.cpp =================================================================== --- src/regex.cpp +++ src/regex.cpp @@ -65,7 +65,7 @@ __code_(ecode) {} -regex_error::~regex_error() throw() {} +regex_error::~regex_error() _NOEXCEPT {} namespace { Index: src/ios.cpp =================================================================== --- src/ios.cpp +++ src/ios.cpp @@ -84,7 +84,7 @@ { } -ios_base::failure::~failure() throw() +ios_base::failure::~failure() _NOEXCEPT { } Index: include/typeinfo =================================================================== --- include/typeinfo +++ include/typeinfo @@ -150,7 +150,9 @@ { public: bad_cast() _NOEXCEPT; - virtual ~bad_cast() _NOEXCEPT; + bad_cast(const bad_cast&) _NOEXCEPT = default; + bad_cast& operator=(const bad_cast&) _NOEXCEPT = default; + ~bad_cast() _NOEXCEPT; virtual const char* what() const _NOEXCEPT; }; Index: include/system_error =================================================================== --- include/system_error +++ include/system_error @@ -626,6 +626,8 @@ system_error(int __ev, const error_category& __ecat, const string& __what_arg); system_error(int __ev, const error_category& __ecat, const char* __what_arg); system_error(int __ev, const error_category& __ecat); + system_error(const system_error&) _NOEXCEPT = default; + system_error& operator=(const system_error&) _NOEXCEPT = default; ~system_error() _NOEXCEPT; _LIBCPP_ALWAYS_INLINE Index: include/stdexcept =================================================================== --- include/stdexcept +++ include/stdexcept @@ -102,6 +102,9 @@ _LIBCPP_INLINE_VISIBILITY explicit domain_error(const string& __s) : logic_error(__s) {} _LIBCPP_INLINE_VISIBILITY explicit domain_error(const char* __s) : logic_error(__s) {} + domain_error(const domain_error&) _NOEXCEPT = default; + domain_error& operator=(const domain_error&) _NOEXCEPT = default; + virtual ~domain_error() _NOEXCEPT; }; @@ -112,6 +115,9 @@ _LIBCPP_INLINE_VISIBILITY explicit invalid_argument(const string& __s) : logic_error(__s) {} _LIBCPP_INLINE_VISIBILITY explicit invalid_argument(const char* __s) : logic_error(__s) {} + invalid_argument(const invalid_argument&) _NOEXCEPT = default; + invalid_argument& operator=(const invalid_argument&) _NOEXCEPT = default; + virtual ~invalid_argument() _NOEXCEPT; }; @@ -122,6 +128,9 @@ _LIBCPP_INLINE_VISIBILITY explicit length_error(const string& __s) : logic_error(__s) {} _LIBCPP_INLINE_VISIBILITY explicit length_error(const char* __s) : logic_error(__s) {} + length_error(const length_error&) _NOEXCEPT = default; + length_error& operator=(const length_error&) _NOEXCEPT = default; + virtual ~length_error() _NOEXCEPT; }; @@ -132,6 +141,9 @@ _LIBCPP_INLINE_VISIBILITY explicit out_of_range(const string& __s) : logic_error(__s) {} _LIBCPP_INLINE_VISIBILITY explicit out_of_range(const char* __s) : logic_error(__s) {} + out_of_range(const out_of_range&) _NOEXCEPT = default; + out_of_range& operator=(const out_of_range&) _NOEXCEPT = default; + virtual ~out_of_range() _NOEXCEPT; }; @@ -142,6 +154,9 @@ _LIBCPP_INLINE_VISIBILITY explicit range_error(const string& __s) : runtime_error(__s) {} _LIBCPP_INLINE_VISIBILITY explicit range_error(const char* __s) : runtime_error(__s) {} + range_error(const range_error&) _NOEXCEPT = default; + range_error& operator=(const range_error&) _NOEXCEPT = default; + virtual ~range_error() _NOEXCEPT; }; @@ -152,6 +167,9 @@ _LIBCPP_INLINE_VISIBILITY explicit overflow_error(const string& __s) : runtime_error(__s) {} _LIBCPP_INLINE_VISIBILITY explicit overflow_error(const char* __s) : runtime_error(__s) {} + overflow_error(const overflow_error&) _NOEXCEPT = default; + overflow_error& operator=(const overflow_error&) _NOEXCEPT = default; + virtual ~overflow_error() _NOEXCEPT; }; @@ -162,6 +180,9 @@ _LIBCPP_INLINE_VISIBILITY explicit underflow_error(const string& __s) : runtime_error(__s) {} _LIBCPP_INLINE_VISIBILITY explicit underflow_error(const char* __s) : runtime_error(__s) {} + underflow_error(const underflow_error&) _NOEXCEPT = default; + underflow_error& operator=(const underflow_error&) _NOEXCEPT = default; + virtual ~underflow_error() _NOEXCEPT; }; Index: include/regex =================================================================== --- include/regex +++ include/regex @@ -951,7 +951,7 @@ regex_constants::error_type __code_; public: explicit regex_error(regex_constants::error_type __ecode); - virtual ~regex_error() throw(); + virtual ~regex_error() _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY regex_constants::error_type code() const {return __code_;} }; Index: include/new =================================================================== --- include/new +++ include/new @@ -84,6 +84,8 @@ { public: bad_alloc() _NOEXCEPT; + bad_alloc(const bad_alloc&) _NOEXCEPT = default; + bad_alloc& operator=(const bad_alloc&) _NOEXCEPT = default; virtual ~bad_alloc() _NOEXCEPT; virtual const char* what() const _NOEXCEPT; }; @@ -93,6 +95,8 @@ { public: bad_array_new_length() _NOEXCEPT; + bad_array_new_length(const bad_array_new_length&) _NOEXCEPT = default; + bad_array_new_length& operator=(const bad_array_new_length&) _NOEXCEPT = default; virtual ~bad_array_new_length() _NOEXCEPT; virtual const char* what() const _NOEXCEPT; }; @@ -104,6 +108,8 @@ { public: bad_array_length() _NOEXCEPT; + bad_array_length(const bad_array_length&) _NOEXCEPT = default; + bad_array_length& operator=(const bad_array_length&) _NOEXCEPT = default; virtual ~bad_array_length() _NOEXCEPT; virtual const char* what() const _NOEXCEPT; }; Index: include/memory =================================================================== --- include/memory +++ include/memory @@ -1978,39 +1978,39 @@ public: typedef _Tp element_type; - _LIBCPP_INLINE_VISIBILITY explicit auto_ptr(_Tp* __p = 0) throw() : __ptr_(__p) {} - _LIBCPP_INLINE_VISIBILITY auto_ptr(auto_ptr& __p) throw() : __ptr_(__p.release()) {} - template<class _Up> _LIBCPP_INLINE_VISIBILITY auto_ptr(auto_ptr<_Up>& __p) throw() + _LIBCPP_INLINE_VISIBILITY explicit auto_ptr(_Tp* __p = 0) _NOEXCEPT : __ptr_(__p) {} + _LIBCPP_INLINE_VISIBILITY auto_ptr(auto_ptr& __p) _NOEXCEPT : __ptr_(__p.release()) {} + template<class _Up> _LIBCPP_INLINE_VISIBILITY auto_ptr(auto_ptr<_Up>& __p) _NOEXCEPT : __ptr_(__p.release()) {} - _LIBCPP_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr& __p) throw() + _LIBCPP_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr& __p) _NOEXCEPT {reset(__p.release()); return *this;} - template<class _Up> _LIBCPP_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr<_Up>& __p) throw() + template<class _Up> _LIBCPP_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr<_Up>& __p) _NOEXCEPT {reset(__p.release()); return *this;} - _LIBCPP_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr_ref<_Tp> __p) throw() + _LIBCPP_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr_ref<_Tp> __p) _NOEXCEPT {reset(__p.__ptr_); return *this;} - _LIBCPP_INLINE_VISIBILITY ~auto_ptr() throw() {delete __ptr_;} + _LIBCPP_INLINE_VISIBILITY ~auto_ptr() _NOEXCEPT {delete __ptr_;} - _LIBCPP_INLINE_VISIBILITY _Tp& operator*() const throw() + _LIBCPP_INLINE_VISIBILITY _Tp& operator*() const _NOEXCEPT {return *__ptr_;} - _LIBCPP_INLINE_VISIBILITY _Tp* operator->() const throw() {return __ptr_;} - _LIBCPP_INLINE_VISIBILITY _Tp* get() const throw() {return __ptr_;} - _LIBCPP_INLINE_VISIBILITY _Tp* release() throw() + _LIBCPP_INLINE_VISIBILITY _Tp* operator->() const _NOEXCEPT {return __ptr_;} + _LIBCPP_INLINE_VISIBILITY _Tp* get() const _NOEXCEPT {return __ptr_;} + _LIBCPP_INLINE_VISIBILITY _Tp* release() _NOEXCEPT { _Tp* __t = __ptr_; __ptr_ = 0; return __t; } - _LIBCPP_INLINE_VISIBILITY void reset(_Tp* __p = 0) throw() + _LIBCPP_INLINE_VISIBILITY void reset(_Tp* __p = 0) _NOEXCEPT { if (__ptr_ != __p) delete __ptr_; __ptr_ = __p; } - _LIBCPP_INLINE_VISIBILITY auto_ptr(auto_ptr_ref<_Tp> __p) throw() : __ptr_(__p.__ptr_) {} - template<class _Up> _LIBCPP_INLINE_VISIBILITY operator auto_ptr_ref<_Up>() throw() + _LIBCPP_INLINE_VISIBILITY auto_ptr(auto_ptr_ref<_Tp> __p) _NOEXCEPT : __ptr_(__p.__ptr_) {} + template<class _Up> _LIBCPP_INLINE_VISIBILITY operator auto_ptr_ref<_Up>() _NOEXCEPT {auto_ptr_ref<_Up> __t; __t.__ptr_ = release(); return __t;} - template<class _Up> _LIBCPP_INLINE_VISIBILITY operator auto_ptr<_Up>() throw() + template<class _Up> _LIBCPP_INLINE_VISIBILITY operator auto_ptr<_Up>() _NOEXCEPT {return auto_ptr<_Up>(release());} }; @@ -3678,6 +3678,8 @@ : public std::exception { public: + bad_weak_ptr() = default; + bad_weak_ptr(const bad_weak_ptr&) = default; virtual ~bad_weak_ptr() _NOEXCEPT; virtual const char* what() const _NOEXCEPT; }; Index: include/ios =================================================================== --- include/ios +++ include/ios @@ -423,7 +423,9 @@ public: explicit failure(const string& __msg, const error_code& __ec = io_errc::stream); explicit failure(const char* __msg, const error_code& __ec = io_errc::stream); - virtual ~failure() throw(); + failure(const failure&) _NOEXCEPT = default; + failure& operator=(const failure&) _NOEXCEPT = default; + virtual ~failure() _NOEXCEPT; }; class _LIBCPP_TYPE_VIS ios_base::Init Index: include/future =================================================================== --- include/future +++ include/future @@ -505,6 +505,8 @@ error_code __ec_; public: future_error(error_code __ec); + future_error(const future_error&) _NOEXCEPT = default; + future_error& operator=(const future_error&) _NOEXCEPT = default; _LIBCPP_INLINE_VISIBILITY const error_code& code() const _NOEXCEPT {return __ec_;} Index: include/exception =================================================================== --- include/exception +++ include/exception @@ -92,6 +92,7 @@ { public: _LIBCPP_INLINE_VISIBILITY exception() _NOEXCEPT {} + _LIBCPP_INLINE_VISIBILITY exception(const exception&) _NOEXCEPT = default; virtual ~exception() _NOEXCEPT; virtual const char* what() const _NOEXCEPT; }; Index: include/codecvt =================================================================== --- include/codecvt +++ include/codecvt @@ -103,11 +103,11 @@ virtual result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const; - virtual int do_encoding() const throw(); - virtual bool do_always_noconv() const throw(); + virtual int do_encoding() const _NOEXCEPT; + virtual bool do_always_noconv() const _NOEXCEPT; virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const; - virtual int do_max_length() const throw(); + virtual int do_max_length() const _NOEXCEPT; }; template <> @@ -138,11 +138,11 @@ virtual result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const; - virtual int do_encoding() const throw(); - virtual bool do_always_noconv() const throw(); + virtual int do_encoding() const _NOEXCEPT; + virtual bool do_always_noconv() const _NOEXCEPT; virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const; - virtual int do_max_length() const throw(); + virtual int do_max_length() const _NOEXCEPT; }; template <> @@ -173,11 +173,11 @@ virtual result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const; - virtual int do_encoding() const throw(); - virtual bool do_always_noconv() const throw(); + virtual int do_encoding() const _NOEXCEPT; + virtual bool do_always_noconv() const _NOEXCEPT; virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const; - virtual int do_max_length() const throw(); + virtual int do_max_length() const _NOEXCEPT; }; template <class _Elem, unsigned long _Maxcode = 0x10ffff, @@ -226,11 +226,11 @@ virtual result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const; - virtual int do_encoding() const throw(); - virtual bool do_always_noconv() const throw(); + virtual int do_encoding() const _NOEXCEPT; + virtual bool do_always_noconv() const _NOEXCEPT; virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const; - virtual int do_max_length() const throw(); + virtual int do_max_length() const _NOEXCEPT; }; template <> @@ -261,11 +261,11 @@ virtual result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const; - virtual int do_encoding() const throw(); - virtual bool do_always_noconv() const throw(); + virtual int do_encoding() const _NOEXCEPT; + virtual bool do_always_noconv() const _NOEXCEPT; virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const; - virtual int do_max_length() const throw(); + virtual int do_max_length() const _NOEXCEPT; }; template <> @@ -296,11 +296,11 @@ virtual result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const; - virtual int do_encoding() const throw(); - virtual bool do_always_noconv() const throw(); + virtual int do_encoding() const _NOEXCEPT; + virtual bool do_always_noconv() const _NOEXCEPT; virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const; - virtual int do_max_length() const throw(); + virtual int do_max_length() const _NOEXCEPT; }; template <> @@ -331,11 +331,11 @@ virtual result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const; - virtual int do_encoding() const throw(); - virtual bool do_always_noconv() const throw(); + virtual int do_encoding() const _NOEXCEPT; + virtual bool do_always_noconv() const _NOEXCEPT; virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const; - virtual int do_max_length() const throw(); + virtual int do_max_length() const _NOEXCEPT; }; template <> @@ -366,11 +366,11 @@ virtual result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const; - virtual int do_encoding() const throw(); - virtual bool do_always_noconv() const throw(); + virtual int do_encoding() const _NOEXCEPT; + virtual bool do_always_noconv() const _NOEXCEPT; virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const; - virtual int do_max_length() const throw(); + virtual int do_max_length() const _NOEXCEPT; }; template <> @@ -401,11 +401,11 @@ virtual result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const; - virtual int do_encoding() const throw(); - virtual bool do_always_noconv() const throw(); + virtual int do_encoding() const _NOEXCEPT; + virtual bool do_always_noconv() const _NOEXCEPT; virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const; - virtual int do_max_length() const throw(); + virtual int do_max_length() const _NOEXCEPT; }; template <class _Elem, unsigned long _Maxcode = 0x10ffff, @@ -454,11 +454,11 @@ virtual result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const; - virtual int do_encoding() const throw(); - virtual bool do_always_noconv() const throw(); + virtual int do_encoding() const _NOEXCEPT; + virtual bool do_always_noconv() const _NOEXCEPT; virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const; - virtual int do_max_length() const throw(); + virtual int do_max_length() const _NOEXCEPT; }; template <> @@ -489,11 +489,11 @@ virtual result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const; - virtual int do_encoding() const throw(); - virtual bool do_always_noconv() const throw(); + virtual int do_encoding() const _NOEXCEPT; + virtual bool do_always_noconv() const _NOEXCEPT; virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const; - virtual int do_max_length() const throw(); + virtual int do_max_length() const _NOEXCEPT; }; template <> @@ -524,11 +524,11 @@ virtual result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const; - virtual int do_encoding() const throw(); - virtual bool do_always_noconv() const throw(); + virtual int do_encoding() const _NOEXCEPT; + virtual bool do_always_noconv() const _NOEXCEPT; virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const; - virtual int do_max_length() const throw(); + virtual int do_max_length() const _NOEXCEPT; }; template <class _Elem, unsigned long _Maxcode = 0x10ffff, Index: include/__sso_allocator =================================================================== --- include/__sso_allocator +++ include/__sso_allocator @@ -43,9 +43,9 @@ typedef _Tp* pointer; typedef _Tp value_type; - _LIBCPP_INLINE_VISIBILITY __sso_allocator() throw() : __allocated_(false) {} - _LIBCPP_INLINE_VISIBILITY __sso_allocator(const __sso_allocator&) throw() : __allocated_(false) {} - template <class _Up> _LIBCPP_INLINE_VISIBILITY __sso_allocator(const __sso_allocator<_Up, _Np>&) throw() + _LIBCPP_INLINE_VISIBILITY __sso_allocator() _NOEXCEPT : __allocated_(false) {} + _LIBCPP_INLINE_VISIBILITY __sso_allocator(const __sso_allocator&) _NOEXCEPT : __allocated_(false) {} + template <class _Up> _LIBCPP_INLINE_VISIBILITY __sso_allocator(const __sso_allocator<_Up, _Np>&) _NOEXCEPT : __allocated_(false) {} private: __sso_allocator& operator=(const __sso_allocator&); @@ -66,7 +66,7 @@ else _VSTD::__deallocate(__p); } - _LIBCPP_INLINE_VISIBILITY size_type max_size() const throw() {return size_type(~0) / sizeof(_Tp);} + _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT {return size_type(~0) / sizeof(_Tp);} _LIBCPP_INLINE_VISIBILITY bool operator==(__sso_allocator& __a) const {return &buf_ == &__a.buf_;} Index: include/__bit_reference =================================================================== --- include/__bit_reference +++ include/__bit_reference @@ -70,6 +70,9 @@ _LIBCPP_INLINE_VISIBILITY void flip() _NOEXCEPT {*__seg_ ^= __mask_;} _LIBCPP_INLINE_VISIBILITY __bit_iterator<_Cp, false> operator&() const _NOEXCEPT {return __bit_iterator<_Cp, false>(__seg_, static_cast<unsigned>(__ctz(__mask_)));} + + _LIBCPP_INLINE_VISIBILITY + __bit_reference(const __bit_reference&) _NOEXCEPT = default; private: _LIBCPP_INLINE_VISIBILITY __bit_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT @@ -146,6 +149,9 @@ _LIBCPP_INLINE_VISIBILITY __bit_iterator<_Cp, true> operator&() const _NOEXCEPT {return __bit_iterator<_Cp, true>(__seg_, static_cast<unsigned>(__ctz(__mask_)));} + + _LIBCPP_INLINE_VISIBILITY + __bit_const_reference(const __bit_const_reference&) _NOEXCEPT = default; private: _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits