• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
10 // XFAIL: *
11 
12 // <chrono>
13 // class weekday;
14 
15 // template<class charT, class traits>
16 //   basic_ostream<charT, traits>&
17 //   operator<<(basic_ostream<charT, traits>& os, const weekday& wd);
18 //
19 //   Effects: If wd.ok() == true inserts format(os.getloc(), fmt, wd) where fmt is "%a" widened to charT.
20 //     Otherwise inserts unsigned{wd} << " is not a valid weekday".
21 //
22 // template<class charT, class traits>
23 //   basic_ostream<charT, traits>&
24 //   to_stream(basic_ostream<charT, traits>& os, const charT* fmt, const weekday& wd);
25 //
26 //   Effects: Streams wd into os using the format specified by the NTCTS fmt.
27 //   fmt encoding follows the rules specified in 25.11.
28 //
29 // template<class charT, class traits, class Alloc = allocator<charT>>
30 //   basic_istream<charT, traits>&
31 //   from_stream(basic_istream<charT, traits>& is, const charT* fmt,
32 //             weekday& wd, basic_string<charT, traits, Alloc>* abbrev = nullptr,
33 //             minutes* offset = nullptr);
34 //
35 //   Effects: Attempts to parse the input stream is into the weekday wd using
36 //       the format flags given in the NTCTS fmt as specified in 25.12.
37 //     If the parse fails to decode a valid weekday, is.setstate(ios_- base::failbit)
38 //       shall be called and wd shall not be modified.
39 //     If %Z is used and successfully parsed, that value will be assigned
40 //       to *abbrev if abbrev is non-null.
41 //     If %z (or a modified variant) is used and successfully parsed,
42 //       that value will be assigned to *offset if offset is non-null.
43 
44 #include <chrono>
45 #include <type_traits>
46 #include <cassert>
47 #include <iostream>
48 
49 #include "test_macros.h"
50 
main()51 int main()
52 {
53    using weekday = std::chrono::weekday;
54 
55    std::cout << weekday{3};
56 }
57