| 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 |
// UNSUPPORTED: c++03, c++11, c++14, c++17 |
| 9 |
|
| 10 |
// <string> |
| 11 |
|
| 12 |
// template<> struct char_traits<char8_t> |
| 13 |
|
| 14 |
// static constexpr int_type not_eof(int_type c); |
| 15 |
|
| 16 |
#include <string> |
| 17 |
#include <cassert> |
| 18 |
|
| 19 |
#include "test_macros.h" |
| 20 |
|
| 21 |
int main(int, char**) { |
| 22 |
#ifndef TEST_HAS_NO_CHAR8_T |
| 23 |
assert(std::char_traits<char8_t>::not_eof(u8'a') == u8'a'); |
| 24 |
assert(std::char_traits<char8_t>::not_eof(u8'A') == u8'A'); |
| 25 |
assert(std::char_traits<char8_t>::not_eof(0) == 0); |
| 26 |
assert(std::char_traits<char8_t>::not_eof(std::char_traits<char8_t>::eof()) != std::char_traits<char8_t>::eof()); |
| 27 |
#endif |
| 28 |
|
| 29 |
return 0; |
| 30 |
} |