From ff400da2615e92cc866ff6d0f8e596bbd210c660 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Mon, 11 Sep 2017 16:05:42 +0000 Subject: [PATCH] Add include of to , since things in there return strings. Fixes PR#34529. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312923 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/system_error | 1 + .../syserr.errcode.overview/types.pass.cpp} | 11 +++++++++++ .../syserr.errcondition.overview/types.pass.cpp} | 10 ++++++++++ 3 files changed, 22 insertions(+) rename test/std/diagnostics/syserr/{syserr.errcondition/syserr.errcondition.overview/nothing_to_do.pass.cpp => syserr.errcode/syserr.errcode.overview/types.pass.cpp} (52%) rename test/std/diagnostics/syserr/{syserr.errcode/syserr.errcode.overview/nothing_to_do.pass.cpp => syserr.errcondition/syserr.errcondition.overview/types.pass.cpp} (54%) 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 }