• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // UNSUPPORTED: c++03, c++11, c++14, c++17
9 // XFAIL: *
10 
11 // <chrono>
12 // class month;
13 
14 // template<class charT, class traits>
15 //   basic_ostream<charT, traits>&
16 //   operator<<(basic_ostream<charT, traits>& os, const month& m);
17 //
18 //   Effects: If m.ok() == true inserts format(os.getloc(), fmt, m) where fmt is "%b" widened to charT.
19 //   Otherwise inserts int{m} << " is not a valid month".
20 //
21 // template<class charT, class traits>
22 //   basic_ostream<charT, traits>&
23 //   to_stream(basic_ostream<charT, traits>& os, const charT* fmt, const month& m);
24 //
25 //   Effects: Streams m into os using the format specified by the NTCTS fmt.
26 //   fmt encoding follows the rules specified in 25.11.
27 //
28 // template<class charT, class traits, class Alloc = allocator<charT>>
29 //   basic_istream<charT, traits>&
30 //   from_stream(basic_istream<charT, traits>& is, const charT* fmt,
31 //             month& m, basic_string<charT, traits, Alloc>* abbrev = nullptr,
32 //             minutes* offset = nullptr);
33 //
34 //   Effects: Attempts to parse the input stream is into the month m using the format flags
35 //   given in the NTCTS fmt as specified in 25.12. If the parse fails to decode a valid month,
36 //   is.setstate(ios_- base::failbit) shall be called and m shall not be modified.
37 //   If %Z is used and successfully parsed, that value will be assigned to *abbrev if
38 //   abbrev is non-null. If %z (or a modified variant) is used and successfully parsed,
39 //   that value will be assigned to *offset if offset is non-null.
40 
41 #include <chrono>
42 #include <type_traits>
43 #include <cassert>
44 #include <iostream>
45 
46 #include "test_macros.h"
47 
main(int,char **)48 int main(int, char**)
49 {
50    using month = std::chrono::month;
51    std::cout << month{1};
52 
53   return 0;
54 }
55