diff options
Diffstat (limited to 'libcxx')
-rw-r--r-- | libcxx/include/system_error | 1 | ||||
-rw-r--r-- | libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/types.pass.cpp (renamed from libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/nothing_to_do.pass.cpp) | 11 | ||||
-rw-r--r-- | libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/types.pass.cpp (renamed from libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/nothing_to_do.pass.cpp) | 10 |
3 files changed, 22 insertions, 0 deletions
diff --git a/libcxx/include/system_error b/libcxx/include/system_error index a29807db0d6..12745525f57 100644 --- a/libcxx/include/system_error +++ b/libcxx/include/system_error @@ -230,6 +230,7 @@ template <> struct hash<std::error_condition>; #include <type_traits> #include <stdexcept> #include <__functional_base> +#include <string> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/nothing_to_do.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/types.pass.cpp index b58f5c55b64..a2515a4c835 100644 --- a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/nothing_to_do.pass.cpp +++ b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/types.pass.cpp @@ -7,6 +7,17 @@ // //===----------------------------------------------------------------------===// +// <system_error> +// class error_code + +// Make sure that the error_code bits of <system_error> are self-contained. + +#include <system_error> + 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/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/nothing_to_do.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/types.pass.cpp index b58f5c55b64..5bbca295f6b 100644 --- a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/nothing_to_do.pass.cpp +++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/types.pass.cpp @@ -7,6 +7,16 @@ // //===----------------------------------------------------------------------===// +// <system_error> +// class error_condition + +// Make sure that the error_condition bits of <system_error> are self-contained. + +#include <system_error> + int main() { + std::error_condition x = std::errc(0); + (void) x.category(); // returns a std::error_condition & + (void) x.message(); // returns a std::string } |