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
10
11#include <uchar.h>
12
13#include "test_macros.h"
14
15// When C++ char8_t support is not enabled, definitions of these functions that
16// match the C2X declarations may still be present in the global namespace with
17// a char8_t typedef substituted for the C++ char8_t type. If so, these are not
18// the declarations we are looking for, so don't test for them.
19#if !defined(TEST_HAS_NO_CHAR8_T)
20using U = decltype(::c8rtomb);
21using V = decltype(::mbrtoc8);
22# if defined(_LIBCPP_HAS_NO_C8RTOMB_MBRTOC8)
23// expected-error@-3 {{no member named 'c8rtomb' in the global namespace}}
24// expected-error@-3 {{no member named 'mbrtoc8' in the global namespace}}
25# else
26// expected-no-diagnostics
27# endif
28#else
29// expected-no-diagnostics
30#endif
31

source code of libcxx/test/std/strings/c.strings/no_c8rtomb_mbrtoc8.verify.cpp