message.pass.cpp 687 B

123456789101112131415161718192021222324252627
  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. // string message() const;
  11. #include <system_error>
  12. #include <string>
  13. #include <cassert>
  14. #include "test_macros.h"
  15. int main(int, char**)
  16. {
  17. const std::error_code ec(6, std::generic_category());
  18. assert(ec.message() == std::generic_category().message(6));
  19. return 0;
  20. }