stream_inserter.pass.cpp 802 B

123456789101112131415161718192021222324252627282930
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. // <system_error>
  9. // class error_code
  10. // template <class charT, class traits>
  11. // basic_ostream<charT,traits>&
  12. // operator<<(basic_ostream<charT,traits>& os, const error_code& ec);
  13. #include <system_error>
  14. #include <sstream>
  15. #include <cassert>
  16. #include "test_macros.h"
  17. int main(int, char**)
  18. {
  19. std::ostringstream out;
  20. out << std::error_code(std::io_errc::stream);
  21. assert(out.str() == "iostream:1");
  22. return 0;
  23. }