Index: include/std/system_error =================================================================== --- include/std/system_error (revision 246076) +++ include/std/system_error (working copy) @@ -268,6 +268,8 @@ // DR 804. private: + friend class hash; + int _M_value; const error_category* _M_cat; }; @@ -372,8 +374,6 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#ifndef _GLIBCXX_COMPATIBILITY_CXX0X - #include namespace std _GLIBCXX_VISIBILITY(default) @@ -380,6 +380,7 @@ { _GLIBCXX_BEGIN_NAMESPACE_VERSION +#ifndef _GLIBCXX_COMPATIBILITY_CXX0X // DR 1182. /// std::hash specialization for error_code. template<> @@ -393,12 +394,25 @@ return std::_Hash_impl::__hash_combine(__e._M_cat, __tmp); } }; +#endif // _GLIBCXX_COMPATIBILITY_CXX0X + // DR 2686. + /// std::hash specialization for error_condition. + template<> + struct hash + : public __hash_base + { + size_t + operator()(const error_condition& __e) const noexcept + { + const size_t __tmp = std::_Hash_impl::hash(__e._M_value); + return std::_Hash_impl::__hash_combine(__e._M_cat, __tmp); + } + }; + _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#endif // _GLIBCXX_COMPATIBILITY_CXX0X - #endif // C++11 #endif // _GLIBCXX_SYSTEM_ERROR Index: testsuite/20_util/hash/operators/size_t.cc =================================================================== --- testsuite/20_util/hash/operators/size_t.cc (revision 246076) +++ testsuite/20_util/hash/operators/size_t.cc (working copy) @@ -43,6 +43,7 @@ void test01() { do_test(); + do_test(); } int main() Index: testsuite/20_util/hash/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/hash/requirements/explicit_instantiation.cc (revision 246076) +++ testsuite/20_util/hash/requirements/explicit_instantiation.cc (working copy) @@ -40,6 +40,7 @@ template class std::hash; template class std::hash; template class std::hash; +template class std::hash; #ifdef _GLIBCXX_USE_WCHAR_T template class std::hash;