File tree Expand file tree Collapse file tree 5 files changed +22
-0
lines changed
libcxx/utilities/text_encoding
std/utilities/text_encoding/text_encoding.members
utils/libcxx/test/features Expand file tree Collapse file tree 5 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 8484// in all versions of the library are available.
8585#if !_LIBCPP_HAS_VENDOR_AVAILABILITY_ANNOTATIONS
8686
87+ # define _LIBCPP_INTRODUCED_IN_LLVM_22 1
88+ # define _LIBCPP_INTRODUCED_IN_LLVM_22_ATTRIBUTE /* nothing */
89+
8790# define _LIBCPP_INTRODUCED_IN_LLVM_21 1
8891# define _LIBCPP_INTRODUCED_IN_LLVM_21_ATTRIBUTE /* nothing */
8992
112115
113116// clang-format off
114117
118+ // LLVM 22
119+ # define _LIBCPP_INTRODUCED_IN_LLVM_22 0
120+ # define _LIBCPP_INTRODUCED_IN_LLVM_22_ATTRIBUTE __attribute__ ((unavailable))
121+
115122// LLVM 21
116123// TODO: Fill this in
117124# define _LIBCPP_INTRODUCED_IN_LLVM_21 0
317324#define _LIBCPP_AVAILABILITY_HAS_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE _LIBCPP_INTRODUCED_IN_LLVM_21
318325// No attribute, since we've had bad_function_call::what() in the headers before
319326
327+ // Controls whether the internal implementation for text_encoding::environment() -> te_impl::__environment() is available
328+ #define _LIBCPP_AVAILABILITY_HAS_TE_ENVIRONMENT _LIBCPP_INTRODUCED_IN_LLVM_22
329+ #define _LIBCPP_AVAILABILITY_TE_ENVIRONMENT _LIBCPP_INTRODUCED_IN_LLVM_22_ATTRIBUTE
330+
320331// Define availability attributes that depend on both
321332// _LIBCPP_HAS_EXCEPTIONS and _LIBCPP_HAS_RTTI.
322333#if !_LIBCPP_HAS_EXCEPTIONS || !_LIBCPP_HAS_RTTI
Original file line number Diff line number Diff line change @@ -531,12 +531,14 @@ struct __te_impl {
531531 _LIBCPP_HIDDEN static __id __get_win32_acp ();
532532# endif
533533
534+ # if _LIBCPP_AVAILABILITY_HAS_TE_ENVIRONMENT
534535 [[nodiscard]] _LIBCPP_EXPORTED_FROM_ABI static __te_impl __environment ();
535536
536537 template <__id _Id>
537538 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static bool __environment_is () {
538539 return __environment () == _Id;
539540 }
541+ # endif
540542# endif
541543
542544 const __te_data* __encoding_rep_ = __text_encoding_data + 1 ;
Original file line number Diff line number Diff line change 1414// UNSUPPORTED: no-localization
1515// UNSUPPORTED: android
1616// UNSUPPORTED: windows
17+ // UNSUPPORTED: availability-te-environment-missing
1718
1819#include < algorithm>
1920#include < cassert>
Original file line number Diff line number Diff line change 1313
1414// UNSUPPORTED: no-localization
1515// UNSUPPORTED: android
16+ // UNSUPPORTED: availability-te-environment-missing
1617
1718// class text_encoding
1819
Original file line number Diff line number Diff line change 196196 cfg .available_features ,
197197 ),
198198 ),
199+ Feature (
200+ name = "availability-te-environment-missing" ,
201+ when = lambda cfg : BooleanExpression .evaluate (
202+ "!libcpp-has-no-availability-markup && (stdlib=apple-libc++ && !_target-has-llvm-22)" ,
203+ cfg .available_features ,
204+ ),
205+ )
199206]
You can’t perform that action at this time.
0 commit comments