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