Add include of <string> to <system_error>, 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
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user