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// <ios>
10
11// template <class charT, class traits> class basic_ios
12
13// char narrow(char_type c, char dfault) const;
14
15// XFAIL: no-wide-characters
16
17#include <ios>
18#include <cassert>
19
20#include "test_macros.h"
21
22int main(int, char**)
23{
24 const std::wios ios(0);
25 assert(ios.narrow(L'c', '*') == 'c');
26 assert(ios.narrow(L'\u203C', '*') == '*');
27
28 return 0;
29}
30

source code of libcxx/test/std/input.output/iostreams.base/ios/basic.ios.members/narrow.pass.cpp