Skip to content

Commit ec350ad

Browse files
authored
[libc++] Remove availability annotations which can never be triggered (#69226)
According to https://developer.apple.com/support/xcode/, quite a few of our availability macros don't do anything anymore, so we might as well remove them to clean up the code a bit.
1 parent f0e100a commit ec350ad

File tree

152 files changed

+101
-630
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+101
-630
lines changed

libcxx/docs/ReleaseNotes/18.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ Improvements and New Features
7272
Deprecations and Removals
7373
-------------------------
7474

75+
- Availability macros which will never trigger an error have been removed. This includes anything that has been
76+
introduced before macOS 10.13, iOS 12, tvOS 12 and watchOS 4. This shouldn't affect anybody, since AppleClang 15
77+
doesn't support any older OSes. If you are a vendor and make use of these macros, please inform the libc++ team so we
78+
can re-introduce them and consider upstreaming support for your platform.
79+
7580
- The non-conforming constructor ``std::future_error(std::error_code)`` has been removed. Please use the
7681
``std::future_error(std::future_errc)`` constructor provided in C++17 instead.
7782

libcxx/docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Libc++ also supports common platforms and architectures:
127127
=============== ========================= ============================
128128
Target platform Target architecture Notes
129129
=============== ========================= ============================
130-
macOS 10.9+ i386, x86_64, arm64 Building the shared library itself requires targetting macOS 10.13+
130+
macOS 10.13+ i386, x86_64, arm64
131131
FreeBSD 12+ i386, x86_64, arm
132132
Linux i386, x86_64, arm, arm64 Only glibc-2.24 and later and no other libc is officially supported
133133
Android 5.0+ i386, x86_64, arm, arm64

libcxx/include/__availability

Lines changed: 8 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,6 @@
8787

8888
#if defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
8989

90-
// This controls the availability of std::shared_mutex and std::shared_timed_mutex,
91-
// which were added to the dylib later.
92-
// # define _LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX
93-
# define _LIBCPP_AVAILABILITY_SHARED_MUTEX
94-
9590
// These macros control the availability of std::bad_optional_access and
9691
// other exception types. These were put in the shared library to prevent
9792
// code bloat from every user program defining the vtable for these exception
@@ -109,41 +104,6 @@
109104
// # define _LIBCPP_AVAILABILITY_HAS_NO_BAD_ANY_CAST
110105
# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST
111106

112-
// This controls the availability of std::uncaught_exceptions().
113-
// # define _LIBCPP_AVAILABILITY_HAS_NO_UNCAUGHT_EXCEPTIONS
114-
# define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS
115-
116-
// This controls the availability of the sized version of ::operator delete,
117-
// ::operator delete[], and their align_val_t variants, which were all added
118-
// in C++17, and hence not present in early dylibs.
119-
// # define _LIBCPP_AVAILABILITY_HAS_NO_SIZED_NEW_DELETE
120-
# define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE
121-
122-
// This controls the availability of the std::future_error exception.
123-
//
124-
// Note that when exceptions are disabled, the methods that normally throw
125-
// std::future_error can be used even on older deployment targets, but those
126-
// methods will abort instead of throwing.
127-
// # define _LIBCPP_AVAILABILITY_HAS_NO_FUTURE_ERROR
128-
# define _LIBCPP_AVAILABILITY_FUTURE_ERROR
129-
130-
// This controls the availability of std::type_info's vtable.
131-
// I can't imagine how using std::type_info can work at all if
132-
// this isn't supported.
133-
// # define _LIBCPP_AVAILABILITY_HAS_NO_TYPEINFO_VTABLE
134-
# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
135-
136-
// This controls the availability of std::locale::category members
137-
// (e.g. std::locale::collate), which are defined in the dylib.
138-
// # define _LIBCPP_AVAILABILITY_HAS_NO_LOCALE_CATEGORY
139-
# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
140-
141-
// This controls the availability of atomic operations on std::shared_ptr
142-
// (e.g. `std::atomic_store(std::shared_ptr)`), which require a shared
143-
// lock table located in the dylib.
144-
// # define _LIBCPP_AVAILABILITY_HAS_NO_ATOMIC_SHARED_PTR
145-
# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
146-
147107
// These macros control the availability of all parts of <filesystem> that
148108
// depend on something in the dylib.
149109
// # define _LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM_LIBRARY
@@ -192,100 +152,14 @@
192152

193153
#elif defined(__APPLE__)
194154

195-
// shared_mutex and shared_timed_mutex
196-
# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200) || \
197-
(defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \
198-
(defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) || \
199-
(defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000)
200-
# define _LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX
201-
# endif
202-
# define _LIBCPP_AVAILABILITY_SHARED_MUTEX \
203-
__attribute__((availability(macos,strict,introduced=10.12))) \
204-
__attribute__((availability(ios,strict,introduced=10.0))) \
205-
__attribute__((availability(tvos,strict,introduced=10.0))) \
206-
__attribute__((availability(watchos,strict,introduced=3.0)))
207-
208-
// bad_optional_access, bad_variant_access and bad_any_cast
209-
// Note: bad_optional_access & friends were not introduced in the matching
210-
// macOS and iOS versions, so the version mismatch between macOS and others
211-
// is intended.
212-
# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101300) || \
213-
(defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 120000) || \
214-
(defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 120000) || \
215-
(defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 50000)
216-
# define _LIBCPP_AVAILABILITY_HAS_NO_BAD_OPTIONAL_ACCESS
217-
# define _LIBCPP_AVAILABILITY_HAS_NO_BAD_VARIANT_ACCESS
218-
# define _LIBCPP_AVAILABILITY_HAS_NO_BAD_ANY_CAST
219-
# endif
220-
# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS \
221-
__attribute__((availability(macos,strict,introduced=10.13))) \
222-
__attribute__((availability(ios,strict,introduced=12.0))) \
223-
__attribute__((availability(tvos,strict,introduced=12.0))) \
224-
__attribute__((availability(watchos,strict,introduced=5.0)))
225-
# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS \
226-
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
227-
# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST \
228-
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
229-
230-
// uncaught_exceptions
231-
# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200) || \
232-
(defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \
233-
(defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) || \
234-
(defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000)
235-
# define _LIBCPP_AVAILABILITY_HAS_NO_UNCAUGHT_EXCEPTIONS
236-
# endif
237-
# define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS \
238-
__attribute__((availability(macos,strict,introduced=10.12))) \
239-
__attribute__((availability(ios,strict,introduced=10.0))) \
240-
__attribute__((availability(tvos,strict,introduced=10.0))) \
241-
__attribute__((availability(watchos,strict,introduced=3.0)))
242-
243-
// sized operator new and sized operator delete
244-
# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200) || \
245-
(defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \
246-
(defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) || \
247-
(defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000)
248-
# define _LIBCPP_AVAILABILITY_HAS_NO_SIZED_NEW_DELETE
249-
# endif
250-
# define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE \
251-
__attribute__((availability(macos,strict,introduced=10.12))) \
252-
__attribute__((availability(ios,strict,introduced=10.0))) \
253-
__attribute__((availability(tvos,strict,introduced=10.0))) \
254-
__attribute__((availability(watchos,strict,introduced=3.0)))
255-
256-
// future_error
257-
# if (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 60000)
258-
# define _LIBCPP_AVAILABILITY_HAS_NO_FUTURE_ERROR
259-
# endif
260-
# define _LIBCPP_AVAILABILITY_FUTURE_ERROR \
261-
__attribute__((availability(ios,strict,introduced=6.0)))
262-
263-
// type_info's vtable
264-
# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 100900) || \
265-
(defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 70000)
266-
# define _LIBCPP_AVAILABILITY_HAS_NO_TYPEINFO_VTABLE
267-
# endif
268-
# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE \
269-
__attribute__((availability(macos,strict,introduced=10.9))) \
270-
__attribute__((availability(ios,strict,introduced=7.0)))
271-
272-
// locale::category
273-
# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 100900) || \
274-
(defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 70000)
275-
# define _LIBCPP_AVAILABILITY_HAS_NO_LOCALE_CATEGORY
276-
# endif
277-
# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY \
278-
__attribute__((availability(macos,strict,introduced=10.9))) \
279-
__attribute__((availability(ios,strict,introduced=7.0)))
280-
281-
// atomic operations on shared_ptr
282-
# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 100900) || \
283-
(defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 70000)
284-
# define _LIBCPP_AVAILABILITY_HAS_NO_ATOMIC_SHARED_PTR
285-
# endif
286-
# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR \
287-
__attribute__((availability(macos,strict,introduced=10.9))) \
288-
__attribute__((availability(ios,strict,introduced=7.0)))
155+
# if (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 50000)
156+
# define _LIBCPP_AVAILABILITY_HAS_NO_BAD_OPTIONAL_ACCESS
157+
# define _LIBCPP_AVAILABILITY_HAS_NO_BAD_VARIANT_ACCESS
158+
# define _LIBCPP_AVAILABILITY_HAS_NO_BAD_ANY_CAST
159+
# endif
160+
# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((availability(watchos,strict,introduced=5.0)))
161+
# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
162+
# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
289163

290164
// <filesystem>
291165
# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500) || \
@@ -385,12 +259,10 @@
385259
// Those are defined in terms of the availability attributes above, and
386260
// should not be vendor-specific.
387261
#if defined(_LIBCPP_HAS_NO_EXCEPTIONS)
388-
# define _LIBCPP_AVAILABILITY_FUTURE
389262
# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
390263
# define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
391264
# define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
392265
#else
393-
# define _LIBCPP_AVAILABILITY_FUTURE _LIBCPP_AVAILABILITY_FUTURE_ERROR
394266
# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST _LIBCPP_AVAILABILITY_BAD_ANY_CAST
395267
# define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
396268
# define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS

libcxx/include/__exception/operations.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ _LIBCPP_EXPORTED_FROM_ABI terminate_handler set_terminate(terminate_handler) _NO
3131
_LIBCPP_EXPORTED_FROM_ABI terminate_handler get_terminate() _NOEXCEPT;
3232

3333
_LIBCPP_EXPORTED_FROM_ABI bool uncaught_exception() _NOEXCEPT;
34-
_LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS int uncaught_exceptions() _NOEXCEPT;
34+
_LIBCPP_EXPORTED_FROM_ABI int uncaught_exceptions() _NOEXCEPT;
3535

3636
class _LIBCPP_EXPORTED_FROM_ABI exception_ptr;
3737

libcxx/include/__locale

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public:
7878
class _LIBCPP_EXPORTED_FROM_ABI id;
7979

8080
typedef int category;
81-
_LIBCPP_AVAILABILITY_LOCALE_CATEGORY
81+
8282
static const category // values assigned here are for exposition only
8383
none = 0,
8484
collate = LC_COLLATE_MASK,

libcxx/include/__memory/shared_ptr.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,8 +1985,7 @@ class _LIBCPP_EXPORTED_FROM_ABI __sp_mut
19851985
friend _LIBCPP_EXPORTED_FROM_ABI __sp_mut& __get_sp_mut(const void*);
19861986
};
19871987

1988-
_LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
1989-
__sp_mut& __get_sp_mut(const void*);
1988+
_LIBCPP_EXPORTED_FROM_ABI __sp_mut& __get_sp_mut(const void*);
19901989

19911990
template <class _Tp>
19921991
inline _LIBCPP_INLINE_VISIBILITY
@@ -1997,7 +1996,6 @@ atomic_is_lock_free(const shared_ptr<_Tp>*)
19971996
}
19981997

19991998
template <class _Tp>
2000-
_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
20011999
_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp>
20022000
atomic_load(const shared_ptr<_Tp>* __p)
20032001
{
@@ -2010,15 +2008,13 @@ atomic_load(const shared_ptr<_Tp>* __p)
20102008

20112009
template <class _Tp>
20122010
inline _LIBCPP_INLINE_VISIBILITY
2013-
_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
20142011
shared_ptr<_Tp>
20152012
atomic_load_explicit(const shared_ptr<_Tp>* __p, memory_order)
20162013
{
20172014
return std::atomic_load(__p);
20182015
}
20192016

20202017
template <class _Tp>
2021-
_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
20222018
_LIBCPP_HIDE_FROM_ABI void
20232019
atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
20242020
{
@@ -2030,15 +2026,13 @@ atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
20302026

20312027
template <class _Tp>
20322028
inline _LIBCPP_INLINE_VISIBILITY
2033-
_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
20342029
void
20352030
atomic_store_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
20362031
{
20372032
std::atomic_store(__p, __r);
20382033
}
20392034

20402035
template <class _Tp>
2041-
_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
20422036
_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp>
20432037
atomic_exchange(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
20442038
{
@@ -2051,15 +2045,13 @@ atomic_exchange(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
20512045

20522046
template <class _Tp>
20532047
inline _LIBCPP_INLINE_VISIBILITY
2054-
_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
20552048
shared_ptr<_Tp>
20562049
atomic_exchange_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
20572050
{
20582051
return std::atomic_exchange(__p, __r);
20592052
}
20602053

20612054
template <class _Tp>
2062-
_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
20632055
_LIBCPP_HIDE_FROM_ABI bool
20642056
atomic_compare_exchange_strong(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
20652057
{
@@ -2081,7 +2073,6 @@ atomic_compare_exchange_strong(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, share
20812073

20822074
template <class _Tp>
20832075
inline _LIBCPP_INLINE_VISIBILITY
2084-
_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
20852076
bool
20862077
atomic_compare_exchange_weak(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
20872078
{
@@ -2090,7 +2081,6 @@ atomic_compare_exchange_weak(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_
20902081

20912082
template <class _Tp>
20922083
inline _LIBCPP_INLINE_VISIBILITY
2093-
_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
20942084
bool
20952085
atomic_compare_exchange_strong_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
20962086
shared_ptr<_Tp> __w, memory_order, memory_order)
@@ -2100,7 +2090,6 @@ atomic_compare_exchange_strong_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* _
21002090

21012091
template <class _Tp>
21022092
inline _LIBCPP_INLINE_VISIBILITY
2103-
_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
21042093
bool
21052094
atomic_compare_exchange_weak_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
21062095
shared_ptr<_Tp> __w, memory_order, memory_order)

libcxx/include/__utility/small_buffer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class __small_buffer {
6262
}
6363

6464
template <class _Stored>
65-
_LIBCPP_AVAILABILITY_SIZED_NEW_DELETE _LIBCPP_HIDE_FROM_ABI _Stored* __alloc() {
65+
_LIBCPP_HIDE_FROM_ABI _Stored* __alloc() {
6666
if constexpr (__fits_in_buffer<_Stored>) {
6767
return std::launder(reinterpret_cast<_Stored*>(__buffer_));
6868
} else {
@@ -73,13 +73,13 @@ class __small_buffer {
7373
}
7474

7575
template <class _Stored>
76-
_LIBCPP_AVAILABILITY_SIZED_NEW_DELETE _LIBCPP_HIDE_FROM_ABI void __dealloc() noexcept {
76+
_LIBCPP_HIDE_FROM_ABI void __dealloc() noexcept {
7777
if constexpr (!__fits_in_buffer<_Stored>)
7878
::operator delete[](*reinterpret_cast<void**>(__buffer_), sizeof(_Stored), align_val_t{alignof(_Stored)});
7979
}
8080

8181
template <class _Stored, class... _Args>
82-
_LIBCPP_AVAILABILITY_SIZED_NEW_DELETE _LIBCPP_HIDE_FROM_ABI void __construct(_Args&&... __args) {
82+
_LIBCPP_HIDE_FROM_ABI void __construct(_Args&&... __args) {
8383
_Stored* __buffer = __alloc<_Stored>();
8484
auto __guard = std::__make_exception_guard([&] { __dealloc<_Stored>(); });
8585
std::construct_at(__buffer, std::forward<_Args>(__args)...);

0 commit comments

Comments
 (0)