diff --git a/include/system_error b/include/system_error index a29807db0..12745525f 100644 --- a/include/system_error +++ b/include/system_error @@ -230,6 +230,7 @@ template <> struct hash; #include #include #include <__functional_base> +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/nothing_to_do.pass.cpp b/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/types.pass.cpp similarity index 52% rename from test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/nothing_to_do.pass.cpp rename to test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/types.pass.cpp index b58f5c55b..a2515a4c8 100644 --- a/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/nothing_to_do.pass.cpp +++ b/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/types.pass.cpp @@ -7,6 +7,17 @@ // //===----------------------------------------------------------------------===// +// +// class error_code + +// Make sure that the error_code bits of are self-contained. + +#include + int main() { + std::error_code x; + (void) x.category(); // returns a std::error_category & + (void) x.default_error_condition(); // std::error_condition + (void) x.message(); // returns a std::string } diff --git a/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/nothing_to_do.pass.cpp b/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/types.pass.cpp similarity index 54% rename from test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/nothing_to_do.pass.cpp rename to test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/types.pass.cpp index b58f5c55b..5bbca295f 100644 --- a/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/nothing_to_do.pass.cpp +++ b/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/types.pass.cpp @@ -7,6 +7,16 @@ // //===----------------------------------------------------------------------===// +// +// class error_condition + +// Make sure that the error_condition bits of are self-contained. + +#include + int main() { + std::error_condition x = std::errc(0); + (void) x.category(); // returns a std::error_condition & + (void) x.message(); // returns a std::string }