瀏覽代碼

Add noexcept(false) to more strongly indicate that not being noexcept is important for hash tests.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@299735 91177308-0d34-0410-b5e6-96231b3b80d8
Billy Robert O'Neal III 8 年之前
父節點
當前提交
0bdae913c3

+ 1 - 1
test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp

@@ -50,7 +50,7 @@ namespace std {
 
 template <class T>
 struct hash<::min_pointer<T, std::integral_constant<size_t, 1>>> {
-  size_t operator()(::min_pointer<T, std::integral_constant<size_t, 1>> p) const {
+  size_t operator()(::min_pointer<T, std::integral_constant<size_t, 1>> p) const noexcept(false) {
     if (!p) return 0;
     return std::hash<T*>{}(std::addressof(*p));
   }

+ 1 - 1
test/std/utilities/optional/optional.hash/hash.pass.cpp

@@ -26,7 +26,7 @@ namespace std {
 
 template <>
 struct hash<B> {
-  size_t operator()(B const&) { return 0; }
+  size_t operator()(B const&) noexcept(false) { return 0; }
 };
 
 }