//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class system_error // system_error(error_code ec); // Test is slightly non-portable #include #include #include int main() { std::system_error se(static_cast(std::errc::not_a_directory), std::generic_category(), "some text"); assert(se.code() == std::make_error_code(std::errc::not_a_directory)); std::string what_message(se.what()); assert(what_message.find("Not a directory") != std::string::npos); }