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 
11 // This test relies on P0482 being fixed, which isn't in
12 // older Apple dylibs
13 //
14 // XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
15 
16 // <locale>
17 
18 // template <> class codecvt<char32_t, char8_t, mbstate_t>
19 
20 // int max_length() const noexcept;
21 
22 #include <cassert>
23 #include <locale>
24 
main(int,char **)25 int main(int, char**) {
26   using F = std::codecvt<char32_t, char8_t, std::mbstate_t>;
27   const F& f = std::use_facet<F>(std::locale::classic());
28   assert(f.max_length() == 4);
29   static_assert(noexcept(f.max_length()));
30   return 0;
31 }
32