This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pedantic error: incongruent exception specifications in TR1 <functional>


Hi again,
> But I don't think it's ok, because the specialization taking a string
> by value can throw.
I applied the below.

Paolo.

////////////////
2009-08-07  Paolo Carlini  <paolo.carlini@oracle.com>

	* src/hash.cc (hash<string>::operator()(string),
	hash<wstring>::operator()(wstring)): Do not decorate as throwing
	nothing.
	* include/bits/functional_hash.h (hash<error_code>::
	operator()(error_code)): Likewise.
Index: src/hash.cc
===================================================================
--- src/hash.cc	(revision 150558)
+++ src/hash.cc	(working copy)
@@ -72,7 +72,7 @@
 #ifndef _GLIBCXX_LONG_DOUBLE_COMPAT_IMPL
   template<>
     size_t
-    hash<string>::operator()(string __s) const throw ()
+    hash<string>::operator()(string __s) const
     { return _Fnv_hash<>::hash(__s.data(), __s.length()); }
 
   template<>
@@ -83,7 +83,7 @@
 #ifdef _GLIBCXX_USE_WCHAR_T
   template<>
     size_t
-    hash<wstring>::operator()(wstring __s) const throw ()
+    hash<wstring>::operator()(wstring __s) const
     {
       const char* __p = reinterpret_cast<const char*>(__s.data());
       return _Fnv_hash<>::hash(__p, __s.length() * sizeof(wchar_t));
Index: include/bits/functional_hash.h
===================================================================
--- include/bits/functional_hash.h	(revision 150558)
+++ include/bits/functional_hash.h	(working copy)
@@ -1,6 +1,6 @@
 // functional_hash.h header -*- C++ -*-
 
-// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009 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
@@ -61,7 +61,7 @@
 
   template<>
     _GLIBCXX_PURE size_t
-    hash<error_code>::operator()(error_code) const throw ();
+    hash<error_code>::operator()(error_code) const;
 }
 
 #endif // _FUNCTIONAL_HASH_H

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]