Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions libcxx/include/__config
Original file line number Diff line number Diff line change
Expand Up @@ -1021,9 +1021,7 @@ typedef __char32_t char32_t;
// the latter depends on internal GNU libc details that are not appropriate
// to depend on here, so any declarations present when __cpp_char8_t is not
// defined are ignored.
# if defined(__clang__)
# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 1
# elif defined(_LIBCPP_GLIBC_PREREQ)
# if defined(_LIBCPP_GLIBC_PREREQ)
# if _LIBCPP_GLIBC_PREREQ(2, 36) && defined(__cpp_char8_t)
# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 1
# else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
// __STDC_UTF_16__ may or may not be defined by the C standard library
// __STDC_UTF_32__ may or may not be defined by the C standard library

#if !defined(TEST_HAS_NO_C8RTOMB_MBRTOC8)
ASSERT_SAME_TYPE(size_t, decltype(mbrtoc8((char8_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
ASSERT_SAME_TYPE(size_t, decltype(c8rtomb((char*)0, (char8_t)0, (mbstate_t*)0)));
#endif

ASSERT_SAME_TYPE(size_t, decltype(mbrtoc16((char16_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
ASSERT_SAME_TYPE(size_t, decltype(c16rtomb((char*)0, (char16_t)0, (mbstate_t*)0)));

Expand Down

This file was deleted.

5 changes: 5 additions & 0 deletions libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
// __STDC_UTF_16__ may or may not be defined by the C standard library
// __STDC_UTF_32__ may or may not be defined by the C standard library

#if !defined(TEST_HAS_NO_C8RTOMB_MBRTOC8)
ASSERT_SAME_TYPE(std::size_t, decltype(std::mbrtoc8((char8_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
ASSERT_SAME_TYPE(std::size_t, decltype(std::c8rtomb((char*)0, (char8_t)0, (mbstate_t*)0)));
#endif

ASSERT_SAME_TYPE(std::size_t, decltype(std::mbrtoc16((char16_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
ASSERT_SAME_TYPE(std::size_t, decltype(std::c16rtomb((char*)0, (char16_t)0, (mbstate_t*)0)));

Expand Down

This file was deleted.

30 changes: 30 additions & 0 deletions libcxx/test/std/strings/c.strings/no_c8rtomb_mbrtoc8.verify.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++03

#include <uchar.h>

#include "test_macros.h"

// When C++ char8_t support is not enabled, definitions of these functions that
// match the C2X declarations may still be present in the global namespace with
// a char8_t typedef substituted for the C++ char8_t type. If so, these are not
// the declarations we are looking for, so don't test for them.
#if !defined(TEST_HAS_NO_CHAR8_T)
using U = decltype(::c8rtomb);
using V = decltype(::mbrtoc8);
# if !_LIBCPP_HAS_C8RTOMB_MBRTOC8
// expected-error@-3 {{no member named 'c8rtomb' in the global namespace}}
// expected-error@-3 {{no member named 'mbrtoc8' in the global namespace}}
# else
// expected-no-diagnostics
# endif
#else
// expected-no-diagnostics
#endif
17 changes: 0 additions & 17 deletions libcxx/utils/libcxx/test/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,23 +293,6 @@ def _mingwSupportsModules(cfg):
""",
),
),
# Check for Glibc < 2.36, where there was no support for char8_t functions
Feature(
name="glibc-no-char8_t-support",
when=lambda cfg: "__GLIBC__" in compilerMacros(cfg)
and not sourceBuilds(
cfg,
"""
#include <uchar.h>
#include <wchar.h>
int main(void) {
char8_t c;
mbstate_t s = {0};
return mbrtoc8(&c, "", 0, &s);
}
""",
),
),
Feature(
name="has-unix-headers",
when=lambda cfg: sourceBuilds(
Expand Down
Loading