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 year_month_weekday;
13 
14 // template<class charT, class traits>
15 //     basic_ostream<charT, traits>&
16 //     operator<<(basic_ostream<charT, traits>& os, const year_month_weekday& ym);
17 //
18 // Returns: os << ym.year() << '/' << ym.month().
19 //
20 //
21 // template<class charT, class traits>
22 //     basic_ostream<charT, traits>&
23 //     to_stream(basic_ostream<charT, traits>& os, const charT* fmt, const year_month_weekday& ym);
24 //
25 // Effects: Streams ym into os using the format specified by the NTCTS fmt. fmt encoding follows the rules specified in 25.11.
26 //
27 // template<class charT, class traits, class Alloc = allocator<charT>>
28 //     basic_istream<charT, traits>&
29 //   from_stream(basic_istream<charT, traits>& is, const charT* fmt,
30 //               year_month_weekday& ym, basic_string<charT, traits, Alloc>* abbrev = nullptr,
31 //               minutes* offset = nullptr);
32 //
33 // Effects: Attempts to parse the input stream is into the year_month_weekday ym using the format
34 //         flags given in the NTCTS fmt as specified in 25.12. If the parse fails to decode
35 //         a valid year_month_weekday, is.setstate(ios_- base::failbit) shall be called and ym shall
36 //         not be modified. If %Z is used and successfully parsed, that value will be assigned
37 //         to *abbrev if abbrev is non-null. If %z (or a modified variant) is used and
38 //         successfully parsed, that value will be assigned to *offset if offset is non-null.
39 
40 
41 
42 #include <chrono>
43 #include <type_traits>
44 #include <cassert>
45 #include <iostream>
46 #include "test_macros.h"
47 
main(int,char **)48 int main(int, char**)
49 {
50     using year_month_weekday = std::chrono::year_month_weekday;
51     using year                = std::chrono::year;
52     using month               = std::chrono::month;
53     using weekday             = std::chrono::weekday;
54 
55     std::cout << year_month_weekday{year{2018}, month{3}, weekday{4}};
56 
57   return 0;
58 }
59