]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/eq_int_type.pass.cpp
Vendor import of libc++ trunk r351319 (just before the release_80
[FreeBSD/FreeBSD.git] / test / std / strings / char.traits / char.traits.specializations / char.traits.specializations.char8_t / eq_int_type.pass.cpp
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
11 // <string>
12
13 // template<> struct char_traits<char8_t>
14
15 // static constexpr bool eq_int_type(int_type c1, int_type c2);
16
17 #include <string>
18 #include <cassert>
19
20 #include "test_macros.h"
21
22 int main()
23 {
24 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
25     assert( std::char_traits<char8_t>::eq_int_type(u8'a', u8'a'));
26     assert(!std::char_traits<char8_t>::eq_int_type(u8'a', u8'A'));
27     assert(!std::char_traits<char8_t>::eq_int_type(std::char_traits<char8_t>::eof(), u8'A'));
28     assert( std::char_traits<char8_t>::eq_int_type(std::char_traits<char8_t>::eof(),
29                                                     std::char_traits<char8_t>::eof()));
30 #endif
31 }