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 // <locale>
10 
11 // template <> class codecvt<char32_t, char8_t, mbstate_t>
12 
13 // int encoding() const noexcept;
14 
15 // UNSUPPORTED: c++03, c++11, c++14, c++17
16 
17 // C++20 codecvt specializations for char8_t are not yet implemented:
18 // UNSUPPORTED: libc++
19 
20 #include <cassert>
21 #include <locale>
22 
main(int,char **)23 int main(int, char**) {
24   using F = std::codecvt<char32_t, char8_t, std::mbstate_t>;
25   const F& f = std::use_facet<F>(std::locale::classic());
26   assert(f.encoding() == 0);
27   static_assert(noexcept(f.encoding()));
28   return 0;
29 }
30