[libcxx-commits] [PATCH] D97870: [libc++] Add missing header <cuchar>

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 3 13:27:58 PST 2022


Quuxplusone added a comment.

Continues to look reasonable to me, mod comment about consistency with `cwctype`.



================
Comment at: libcxx/include/cuchar:46-56
+#if !defined(_LIBCPP_CXX03_LANG)
+
+using ::mbstate_t _LIBCPP_USING_IF_EXISTS;
+using ::size_t _LIBCPP_USING_IF_EXISTS;
+
+using ::mbrtoc16 _LIBCPP_USING_IF_EXISTS;
+using ::c16rtomb _LIBCPP_USING_IF_EXISTS;
----------------
Looking at how libc++ does its `cwctype` and `wctype.h`, I suspect you ought to do something isomorphic over here and wrap all this in `#if defined(_LIBCPP_INCLUDED_C_LIBRARY_UCHAR_H)`. (Or else explain in the commit summary why uchar.h's situation is different.)


================
Comment at: libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp:27
+ASSERT_SAME_TYPE(size_t, decltype(mbrtoc32((char32_t*)0, (const char*)0, size_t{}, (mbstate_t*)0)));
+ASSERT_SAME_TYPE(size_t, decltype(c16rtomb((char*)0, char32_t{}, (mbstate_t*)0)));
----------------
Weird mix of `0`-to-mean-nullptr and `{}`-to-mean-zero, but okay. ;)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97870/new/

https://reviews.llvm.org/D97870



More information about the libcxx-commits mailing list