diff mbox

Add exception specs to allocator equality operators

Message ID 20140414151317.GC6807@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely April 14, 2014, 3:13 p.m. UTC
The equality operators for std::allocator were throw() in C++03 and
are noexcept in C++11, but we were missing those specs (and the
problem wasn't caught by the testsuite because of PR50871).

Tested x86_64-linux, committed to trunk.
commit 3043f742f7f31504dd881b55eaf6abaf73d79380
Author: Jonathan Wakely <accu@kayari.org>
Date:   Mon Apr 14 15:55:34 2014 +0100

    	* include/bits/allocator.h (operator==, operator!=): Add exception
    	specifications.
diff mbox

Patch

diff --git a/libstdc++-v3/include/bits/allocator.h b/libstdc++-v3/include/bits/allocator.h
index e293c54..05a06ba 100644
--- a/libstdc++-v3/include/bits/allocator.h
+++ b/libstdc++-v3/include/bits/allocator.h
@@ -126,21 +126,25 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template<typename _T1, typename _T2>
     inline bool
     operator==(const allocator<_T1>&, const allocator<_T2>&)
+    _GLIBCXX_USE_NOEXCEPT
     { return true; }
 
   template<typename _Tp>
     inline bool
     operator==(const allocator<_Tp>&, const allocator<_Tp>&)
+    _GLIBCXX_USE_NOEXCEPT
     { return true; }
 
   template<typename _T1, typename _T2>
     inline bool
     operator!=(const allocator<_T1>&, const allocator<_T2>&)
+    _GLIBCXX_USE_NOEXCEPT
     { return false; }
 
   template<typename _Tp>
     inline bool
     operator!=(const allocator<_Tp>&, const allocator<_Tp>&)
+    _GLIBCXX_USE_NOEXCEPT
     { return false; }
 
   /// @} group allocator