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 day;
14
15 // template<class charT, class traits>
16 // basic_ostream<charT, traits>&
17 // operator<<(basic_ostream<charT, traits>& os, const day& d);
18 //
19 // Effects: Inserts format(fmt, d) where fmt is "%d" widened to charT.
20 // If !d.ok(), appends with " is not a valid day".
21 //
22 // template<class charT, class traits>
23 // basic_ostream<charT, traits>&
24 // to_stream(basic_ostream<charT, traits>& os, const charT* fmt, const day& d);
25 //
26 // Effects: Streams d 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 // day& d, basic_string<charT, traits, Alloc>* abbrev = nullptr,
33 // minutes* offset = nullptr);
34 //
35 // Effects: Attempts to parse the input stream is into the day d using the format flags
36 // given in the NTCTS fmt as specified in 25.12.
37 // If the parse fails to decode a valid day, is.setstate(ios_base::failbit)
38 // shall be called and d shall not be modified.
39 // If %Z is used and successfully parsed, that value will be assigned to *abbrev
40 // if abbrev is non-null. If %z (or a modified variant) is used and
41 // successfully parsed, that value will be assigned to *offset if offset is non-null.
42 //
43
44
45 #include <chrono>
46 #include <type_traits>
47 #include <cassert>
48 #include <iostream>
49
50 #include "test_macros.h"
51
main()52 int main()
53 {
54 using day = std::chrono::day;
55 std::cout << day{1};
56 }
57