From patchwork Fri Nov 18 12:39:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 126406 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id D256FB725D for ; Fri, 18 Nov 2011 23:40:59 +1100 (EST) Received: (qmail 32026 invoked by alias); 18 Nov 2011 12:40:56 -0000 Received: (qmail 31999 invoked by uid 22791); 18 Nov 2011 12:40:51 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from acsinet15.oracle.com (HELO acsinet15.oracle.com) (141.146.126.227) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Nov 2011 12:40:11 +0000 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id pAICe9OD028245 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 18 Nov 2011 12:40:10 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id pAICe990008666 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 18 Nov 2011 12:40:09 GMT Received: from abhmt115.oracle.com (abhmt115.oracle.com [141.146.116.67]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id pAICe3Jd016170; Fri, 18 Nov 2011 06:40:03 -0600 Received: from [192.168.1.4] (/79.51.25.53) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 18 Nov 2011 04:40:02 -0800 Message-ID: <4EC65201.7010209@oracle.com> Date: Fri, 18 Nov 2011 13:39:29 +0100 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: libstdc++ , =?ISO-8859-1?Q?Fran=E7ois_Dumont?= Subject: [v3] Declare std::hash specializations noexcept X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, this makes sure the various hash specializations are declared noexcept. Francois, please let me know if you are seeing something wrong / missing as part of your work... Tested x86_64-linux, committed. Thanks, Paolo. ////////////////////// 2011-11-18 Paolo Carlini * src/hash-long-double-aux.cc: Rename to... * src/hash-long-double-tr1-aux.cc: ... this. * src/compatibility-ldbl.cc: Adjust. * src/hash_tr1.cc: Likewise. * src/hash_c++0x.cc: Don't use src/hash-long-double-aux.cc. * include/bits/functional_hash.h (hash<_Tp*>::operator(), specs for integer types, hash::operator(), hash::operator(), hash::operator()): Declare noexcept. * include/debug/bitset (hash<__debug::bitset>::operator()): Likewise. * include/debug/vector (hash<__debug::vector>::operator()): Likewise. * include/std/system_error (hash::operator()): Likewise. * include/std/thread (hash::operator()): Likewise. * include/std/bitset (hash::operator()): Likewise. * include/std/typeindex (hash::operator()): Likewise. * include/profile/bitset (hash<__profile::vector>::operator()): Likewise. * include/profile/vector (hash<__profile::vector>::operator()): Likewise. * include/ext/vstring.h (hash<__vstring>::operator(), hash<__wvstring>::operator(), hash<__u16vstring>::operator(), hash<__u32vstring>::operator()): Likewise. * include/bits/shared_ptr.h (hash::operator()): Likewise. * include/bits/shared_ptr_base.h (hash<__shared_ptr>::operator()): Likewise. * include/bits/unique_ptr.h (hash::operator()): Likewise. * include/bits/basic_string.h (hash::operator(), hash::operator(), hash::operator(), hash::operator()): Likewise. * include/bits/vector.tcc (hash::operator()): Likewise. * include/bits/stl_bvector.h (hash::operator()): Likewise. * libsupc++/typeinfo (type_info::hash_code): Use noexcept instead of throw(). Index: src/hash_c++0x.cc =================================================================== --- src/hash_c++0x.cc (revision 181470) +++ src/hash_c++0x.cc (working copy) @@ -1,6 +1,6 @@ // std::hash definitions -*- C++ -*- -// Copyright (C) 2010 Free Software Foundation, Inc. +// Copyright (C) 2010, 2011 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -30,5 +30,27 @@ namespace std _GLIBCXX_VISIBILITY(default) { -#include "hash-long-double-aux.cc" + _GLIBCXX_PURE size_t + hash::operator()(long double __val) const noexcept + { + // 0 and -0 both hash to zero. + if (__val == 0.0L) + return 0; + + int __exponent; + __val = __builtin_frexpl(__val, &__exponent); + __val = __val < 0.0l ? -(__val + 0.5l) : __val; + + const long double __mult = __SIZE_MAX__ + 1.0l; + __val *= __mult; + + // Try to use all the bits of the mantissa (really necessary only + // on 32-bit targets, at least for 80-bit floating point formats). + const size_t __hibits = (size_t)__val; + __val = (__val - (long double)__hibits) * __mult; + + const size_t __coeff = __SIZE_MAX__ / __LDBL_MAX_EXP__; + + return __hibits + (size_t)__val + __coeff * __exponent; + } } Index: src/compatibility-ldbl.cc =================================================================== --- src/compatibility-ldbl.cc (revision 181470) +++ src/compatibility-ldbl.cc (working copy) @@ -1,6 +1,6 @@ // Compatibility symbols for -mlong-double-64 compatibility -*- C++ -*- -// Copyright (C) 2006, 2008, 2009, 2010 +// Copyright (C) 2006, 2008, 2009, 2010, 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -69,15 +69,8 @@ // For std::tr1::hash::operator() #define _GLIBCXX_LONG_DOUBLE_COMPAT_IMPL +#include "hash-long-double-tr1-aux.cc" -namespace std _GLIBCXX_VISIBILITY(default) -{ - namespace tr1 - { -#include "hash-long-double-aux.cc" - } -} - // std::tr1::hash::operator() // and std::hash::operator() // are the same, no need to duplicate them. Index: src/hash_tr1.cc =================================================================== --- src/hash_tr1.cc (revision 181470) +++ src/hash_tr1.cc (working copy) @@ -1,6 +1,6 @@ // std::tr1::hash definitions -*- C++ -*- -// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -25,12 +25,12 @@ #include #include +#include "hash-long-double-tr1-aux.cc" + namespace std _GLIBCXX_VISIBILITY(default) { namespace tr1 { -#include "hash-long-double-aux.cc" - #ifndef _GLIBCXX_LONG_DOUBLE_COMPAT_IMPL template<> size_t Index: src/hash-long-double-tr1-aux.cc =================================================================== --- src/hash-long-double-tr1-aux.cc (revision 181470) +++ src/hash-long-double-tr1-aux.cc (working copy) @@ -1,6 +1,6 @@ -// std::hash and std::tr1::hash definitions, long double bits -*- C++ -*- +// std::tr1::hash definitions, long double bits -*- C++ -*- -// Copyright (C) 2010 Free Software Foundation, Inc. +// Copyright (C) 2010, 2011 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -22,29 +22,35 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . - // For long double, careful with random padding bits (e.g., on x86, - // 10 bytes -> 12 bytes) and resort to frexp. - template<> - size_t - hash::operator()(long double __val) const - { - // 0 and -0 both hash to zero. - if (__val == 0.0L) - return 0; +namespace std _GLIBCXX_VISIBILITY(default) +{ + namespace tr1 + { + // For long double, careful with random padding bits (e.g., on x86, + // 10 bytes -> 12 bytes) and resort to frexp. + template<> + size_t + hash::operator()(long double __val) const + { + // 0 and -0 both hash to zero. + if (__val == 0.0L) + return 0; - int __exponent; - __val = __builtin_frexpl(__val, &__exponent); - __val = __val < 0.0l ? -(__val + 0.5l) : __val; + int __exponent; + __val = __builtin_frexpl(__val, &__exponent); + __val = __val < 0.0l ? -(__val + 0.5l) : __val; - const long double __mult = __SIZE_MAX__ + 1.0l; - __val *= __mult; + const long double __mult = __SIZE_MAX__ + 1.0l; + __val *= __mult; - // Try to use all the bits of the mantissa (really necessary only - // on 32-bit targets, at least for 80-bit floating point formats). - const size_t __hibits = (size_t)__val; - __val = (__val - (long double)__hibits) * __mult; + // Try to use all the bits of the mantissa (really necessary only + // on 32-bit targets, at least for 80-bit floating point formats). + const size_t __hibits = (size_t)__val; + __val = (__val - (long double)__hibits) * __mult; - const size_t __coeff = __SIZE_MAX__ / __LDBL_MAX_EXP__; + const size_t __coeff = __SIZE_MAX__ / __LDBL_MAX_EXP__; - return __hibits + (size_t)__val + __coeff * __exponent; - } + return __hibits + (size_t)__val + __coeff * __exponent; + } + } +} Index: src/hash-long-double-aux.cc =================================================================== --- src/hash-long-double-aux.cc (revision 181470) +++ src/hash-long-double-aux.cc (working copy) @@ -1,50 +0,0 @@ -// std::hash and std::tr1::hash definitions, long double bits -*- C++ -*- - -// Copyright (C) 2010 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - - // For long double, careful with random padding bits (e.g., on x86, - // 10 bytes -> 12 bytes) and resort to frexp. - template<> - size_t - hash::operator()(long double __val) const - { - // 0 and -0 both hash to zero. - if (__val == 0.0L) - return 0; - - int __exponent; - __val = __builtin_frexpl(__val, &__exponent); - __val = __val < 0.0l ? -(__val + 0.5l) : __val; - - const long double __mult = __SIZE_MAX__ + 1.0l; - __val *= __mult; - - // Try to use all the bits of the mantissa (really necessary only - // on 32-bit targets, at least for 80-bit floating point formats). - const size_t __hibits = (size_t)__val; - __val = (__val - (long double)__hibits) * __mult; - - const size_t __coeff = __SIZE_MAX__ / __LDBL_MAX_EXP__; - - return __hibits + (size_t)__val + __coeff * __exponent; - } Index: include/debug/bitset =================================================================== --- include/debug/bitset (revision 181470) +++ include/debug/bitset (working copy) @@ -414,7 +414,7 @@ : public __hash_base> { size_t - operator()(const __debug::bitset<_Nb>& __b) const + operator()(const __debug::bitset<_Nb>& __b) const noexcept { return std::hash<_GLIBCXX_STD_C::bitset<_Nb>>()(__b._M_base()); } }; #endif Index: include/debug/vector =================================================================== --- include/debug/vector (revision 181470) +++ include/debug/vector (working copy) @@ -625,7 +625,7 @@ : public __hash_base> { size_t - operator()(const __debug::vector& __b) const + operator()(const __debug::vector& __b) const noexcept { return std::hash<_GLIBCXX_STD_C::vector>() (__b._M_base()); } }; Index: include/std/system_error =================================================================== --- include/std/system_error (revision 181470) +++ include/std/system_error (working copy) @@ -361,7 +361,7 @@ : public __hash_base { size_t - operator()(const error_code& __e) const + operator()(const error_code& __e) const noexcept { const size_t __tmp = std::_Hash_impl::hash(__e._M_value); return std::_Hash_impl::__hash_combine(__e._M_cat, __tmp); Index: include/std/thread =================================================================== --- include/std/thread (revision 181470) +++ include/std/thread (working copy) @@ -221,7 +221,7 @@ : public __hash_base { size_t - operator()(const thread::id& __id) const + operator()(const thread::id& __id) const noexcept { return std::_Hash_impl::hash(__id._M_thread); } }; Index: include/std/bitset =================================================================== --- include/std/bitset (revision 181470) +++ include/std/bitset (working copy) @@ -1555,7 +1555,7 @@ : public __hash_base> { size_t - operator()(const _GLIBCXX_STD_C::bitset<_Nb>& __b) const + operator()(const _GLIBCXX_STD_C::bitset<_Nb>& __b) const noexcept { const size_t __clength = (_Nb + __CHAR_BIT__ - 1) / __CHAR_BIT__; return std::_Hash_impl::hash(__b._M_getdata(), __clength); @@ -1567,7 +1567,7 @@ : public __hash_base> { size_t - operator()(const _GLIBCXX_STD_C::bitset<0>&) const + operator()(const _GLIBCXX_STD_C::bitset<0>&) const noexcept { return 0; } }; Index: include/std/typeindex =================================================================== --- include/std/typeindex (revision 181470) +++ include/std/typeindex (working copy) @@ -76,7 +76,7 @@ { return !_M_target->before(*__rhs._M_target); } size_t - hash_code() const + hash_code() const noexcept { return _M_target->hash_code(); } const char* @@ -97,7 +97,7 @@ typedef type_index argument_type; size_t - operator()(const type_index& __ti) const + operator()(const type_index& __ti) const noexcept { return __ti.hash_code(); } }; Index: include/ext/vstring.h =================================================================== --- include/ext/vstring.h (revision 181470) +++ include/ext/vstring.h (working copy) @@ -2769,7 +2769,7 @@ : public __hash_base { size_t - operator()(const __gnu_cxx::__vstring& __s) const + operator()(const __gnu_cxx::__vstring& __s) const noexcept { return std::_Hash_impl::hash(__s.data(), __s.length()); } }; @@ -2780,7 +2780,7 @@ : public __hash_base { size_t - operator()(const __gnu_cxx::__wvstring& __s) const + operator()(const __gnu_cxx::__wvstring& __s) const noexcept { return std::_Hash_impl::hash(__s.data(), __s.length() * sizeof(wchar_t)); } }; @@ -2793,7 +2793,7 @@ : public __hash_base { size_t - operator()(const __gnu_cxx::__u16vstring& __s) const + operator()(const __gnu_cxx::__u16vstring& __s) const noexcept { return std::_Hash_impl::hash(__s.data(), __s.length() * sizeof(char16_t)); } }; @@ -2804,7 +2804,7 @@ : public __hash_base { size_t - operator()(const __gnu_cxx::__u32vstring& __s) const + operator()(const __gnu_cxx::__u32vstring& __s) const noexcept { return std::_Hash_impl::hash(__s.data(), __s.length() * sizeof(char32_t)); } }; Index: include/profile/bitset =================================================================== --- include/profile/bitset (revision 181470) +++ include/profile/bitset (working copy) @@ -372,7 +372,7 @@ : public __hash_base> { size_t - operator()(const __profile::bitset<_Nb>& __b) const + operator()(const __profile::bitset<_Nb>& __b) const noexcept { return std::hash<_GLIBCXX_STD_C::bitset<_Nb>>()(__b._M_base()); } }; #endif Index: include/profile/vector =================================================================== --- include/profile/vector (revision 181470) +++ include/profile/vector (working copy) @@ -529,7 +529,7 @@ : public __hash_base> { size_t - operator()(const __profile::vector& __b) const + operator()(const __profile::vector& __b) const noexcept { return std::hash<_GLIBCXX_STD_C::vector>() (__b._M_base()); } }; Index: include/bits/shared_ptr.h =================================================================== --- include/bits/shared_ptr.h (revision 181470) +++ include/bits/shared_ptr.h (working copy) @@ -619,7 +619,7 @@ : public __hash_base> { size_t - operator()(const shared_ptr<_Tp>& __s) const + operator()(const shared_ptr<_Tp>& __s) const noexcept { return std::hash<_Tp*>()(__s.get()); } }; Index: include/bits/functional_hash.h =================================================================== --- include/bits/functional_hash.h (revision 181470) +++ include/bits/functional_hash.h (working copy) @@ -66,61 +66,64 @@ struct hash<_Tp*> : public __hash_base { size_t - operator()(_Tp* __p) const + operator()(_Tp* __p) const noexcept { return reinterpret_cast(__p); } }; // Explicit specializations for integer types. #define _Cxx_hashtable_define_trivial_hash(_Tp) \ template<> \ - inline size_t \ - hash<_Tp>::operator()(_Tp __val) const \ - { return static_cast(__val); } + struct hash<_Tp> : public __hash_base \ + { \ + size_t \ + operator()(_Tp __val) const noexcept \ + { return static_cast(__val); } \ + }; /// Explicit specialization for bool. - _Cxx_hashtable_define_trivial_hash(bool); + _Cxx_hashtable_define_trivial_hash(bool) /// Explicit specialization for char. - _Cxx_hashtable_define_trivial_hash(char); + _Cxx_hashtable_define_trivial_hash(char) /// Explicit specialization for signed char. - _Cxx_hashtable_define_trivial_hash(signed char); + _Cxx_hashtable_define_trivial_hash(signed char) /// Explicit specialization for unsigned char. - _Cxx_hashtable_define_trivial_hash(unsigned char); + _Cxx_hashtable_define_trivial_hash(unsigned char) /// Explicit specialization for wchar_t. - _Cxx_hashtable_define_trivial_hash(wchar_t); + _Cxx_hashtable_define_trivial_hash(wchar_t) /// Explicit specialization for char16_t. - _Cxx_hashtable_define_trivial_hash(char16_t); + _Cxx_hashtable_define_trivial_hash(char16_t) /// Explicit specialization for char32_t. - _Cxx_hashtable_define_trivial_hash(char32_t); + _Cxx_hashtable_define_trivial_hash(char32_t) /// Explicit specialization for short. - _Cxx_hashtable_define_trivial_hash(short); + _Cxx_hashtable_define_trivial_hash(short) /// Explicit specialization for int. - _Cxx_hashtable_define_trivial_hash(int); + _Cxx_hashtable_define_trivial_hash(int) /// Explicit specialization for long. - _Cxx_hashtable_define_trivial_hash(long); + _Cxx_hashtable_define_trivial_hash(long) /// Explicit specialization for long long. - _Cxx_hashtable_define_trivial_hash(long long); + _Cxx_hashtable_define_trivial_hash(long long) /// Explicit specialization for unsigned short. - _Cxx_hashtable_define_trivial_hash(unsigned short); + _Cxx_hashtable_define_trivial_hash(unsigned short) /// Explicit specialization for unsigned int. - _Cxx_hashtable_define_trivial_hash(unsigned int); + _Cxx_hashtable_define_trivial_hash(unsigned int) /// Explicit specialization for unsigned long. - _Cxx_hashtable_define_trivial_hash(unsigned long); + _Cxx_hashtable_define_trivial_hash(unsigned long) /// Explicit specialization for unsigned long long. - _Cxx_hashtable_define_trivial_hash(unsigned long long); + _Cxx_hashtable_define_trivial_hash(unsigned long long) #undef _Cxx_hashtable_define_trivial_hash @@ -162,26 +165,36 @@ /// Specialization for float. template<> - inline size_t - hash::operator()(float __val) const + struct hash : public __hash_base { - // 0 and -0 both hash to zero. - return __val != 0.0f ? std::_Hash_impl::hash(__val) : 0; - } + size_t + operator()(float __val) const noexcept + { + // 0 and -0 both hash to zero. + return __val != 0.0f ? std::_Hash_impl::hash(__val) : 0; + } + }; /// Specialization for double. template<> - inline size_t - hash::operator()(double __val) const + struct hash : public __hash_base { - // 0 and -0 both hash to zero. - return __val != 0.0 ? std::_Hash_impl::hash(__val) : 0; - } + size_t + operator()(double __val) const noexcept + { + // 0 and -0 both hash to zero. + return __val != 0.0 ? std::_Hash_impl::hash(__val) : 0; + } + }; /// Specialization for long double. template<> - _GLIBCXX_PURE size_t - hash::operator()(long double __val) const; + struct hash + : public __hash_base + { + _GLIBCXX_PURE size_t + operator()(long double __val) const noexcept; + }; // @} group hashes Index: include/bits/unique_ptr.h =================================================================== --- include/bits/unique_ptr.h (revision 181470) +++ include/bits/unique_ptr.h (working copy) @@ -545,7 +545,7 @@ : public __hash_base> { size_t - operator()(const unique_ptr<_Tp, _Dp>& __u) const + operator()(const unique_ptr<_Tp, _Dp>& __u) const noexcept { typedef unique_ptr<_Tp, _Dp> _UP; return std::hash()(__u.get()); Index: include/bits/basic_string.h =================================================================== --- include/bits/basic_string.h (revision 181470) +++ include/bits/basic_string.h (working copy) @@ -3044,7 +3044,7 @@ : public __hash_base { size_t - operator()(const string& __s) const + operator()(const string& __s) const noexcept { return std::_Hash_impl::hash(__s.data(), __s.length()); } }; @@ -3055,7 +3055,7 @@ : public __hash_base { size_t - operator()(const wstring& __s) const + operator()(const wstring& __s) const noexcept { return std::_Hash_impl::hash(__s.data(), __s.length() * sizeof(wchar_t)); } }; @@ -3069,7 +3069,7 @@ : public __hash_base { size_t - operator()(const u16string& __s) const + operator()(const u16string& __s) const noexcept { return std::_Hash_impl::hash(__s.data(), __s.length() * sizeof(char16_t)); } }; @@ -3080,7 +3080,7 @@ : public __hash_base { size_t - operator()(const u32string& __s) const + operator()(const u32string& __s) const noexcept { return std::_Hash_impl::hash(__s.data(), __s.length() * sizeof(char32_t)); } }; Index: include/bits/vector.tcc =================================================================== --- include/bits/vector.tcc (revision 181470) +++ include/bits/vector.tcc (working copy) @@ -818,7 +818,7 @@ template size_t hash<_GLIBCXX_STD_C::vector>:: - operator()(const _GLIBCXX_STD_C::vector& __b) const + operator()(const _GLIBCXX_STD_C::vector& __b) const noexcept { size_t __hash = 0; using _GLIBCXX_STD_C::_S_word_bit; Index: include/bits/shared_ptr_base.h =================================================================== --- include/bits/shared_ptr_base.h (revision 181470) +++ include/bits/shared_ptr_base.h (working copy) @@ -1450,7 +1450,7 @@ : public __hash_base> { size_t - operator()(const __shared_ptr<_Tp, _Lp>& __s) const + operator()(const __shared_ptr<_Tp, _Lp>& __s) const noexcept { return std::hash<_Tp*>()(__s.get()); } }; Index: include/bits/stl_bvector.h =================================================================== --- include/bits/stl_bvector.h (revision 181470) +++ include/bits/stl_bvector.h (working copy) @@ -1075,7 +1075,7 @@ : public __hash_base> { size_t - operator()(const _GLIBCXX_STD_C::vector& __b) const; + operator()(const _GLIBCXX_STD_C::vector&) const noexcept; }; _GLIBCXX_END_NAMESPACE_VERSION Index: libsupc++/typeinfo =================================================================== --- libsupc++/typeinfo (revision 181470) +++ libsupc++/typeinfo (working copy) @@ -140,7 +140,7 @@ { return !operator==(__arg); } #ifdef __GXX_EXPERIMENTAL_CXX0X__ - size_t hash_code() const throw() + size_t hash_code() const noexcept { # if !__GXX_MERGED_TYPEINFO_NAMES return _Hash_bytes(name(), __builtin_strlen(name()),