Skip to content

Commit e5cf1f4

Browse files
committed
[libc++] Use [[clang::no_specializations]] to diagnose invalid user specializations
1 parent d0a3642 commit e5cf1f4

File tree

95 files changed

+575
-206
lines changed

Some content is hidden

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

95 files changed

+575
-206
lines changed

libcxx/include/__compare/compare_three_way_result.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ struct _LIBCPP_HIDE_FROM_ABI __compare_three_way_result<
3333
};
3434

3535
template <class _Tp, class _Up = _Tp>
36-
struct _LIBCPP_TEMPLATE_VIS compare_three_way_result : __compare_three_way_result<_Tp, _Up, void> {};
36+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS compare_three_way_result
37+
: __compare_three_way_result<_Tp, _Up, void> {};
3738

3839
template <class _Tp, class _Up = _Tp>
3940
using compare_three_way_result_t = typename compare_three_way_result<_Tp, _Up>::type;

libcxx/include/__config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,13 @@ typedef __char32_t char32_t;
11701170
// https://github.com/llvm/llvm-project/pull/118710 has been analyzed
11711171
# define _LIBCPP_NODEBUG
11721172

1173+
# if __has_cpp_attribute(_Clang::__no_specializations__)
1174+
# define _LIBCPP_NO_SPECIALIZATIONS \
1175+
[[_Clang::__no_specializations__("Users are not allowed to specialize this standard library entity")]]
1176+
# else
1177+
# define _LIBCPP_NO_SPECIALIZATIONS
1178+
# endif
1179+
11731180
# if __has_attribute(__standalone_debug__)
11741181
# define _LIBCPP_STANDALONE_DEBUG __attribute__((__standalone_debug__))
11751182
# else

libcxx/include/__cxx03/__type_traits/add_cv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
_LIBCPP_BEGIN_NAMESPACE_STD
1919

2020
template <class _Tp>
21-
struct _LIBCPP_TEMPLATE_VIS add_cv {
21+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DIAGNOSE_SPECIALIZATIONS add_cv {
2222
typedef _LIBCPP_NODEBUG const volatile _Tp type;
2323
};
2424

libcxx/include/__cxx03/__type_traits/add_volatile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
_LIBCPP_BEGIN_NAMESPACE_STD
1919

2020
template <class _Tp>
21-
struct _LIBCPP_TEMPLATE_VIS add_volatile {
21+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DIAGNOSE_SPECIALIZATIONS add_volatile {
2222
typedef _LIBCPP_NODEBUG volatile _Tp type;
2323
};
2424

libcxx/include/__format/format_arg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ class __basic_format_arg_value {
277277
};
278278

279279
template <class _Context>
280-
class _LIBCPP_TEMPLATE_VIS basic_format_arg {
280+
class _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS basic_format_arg {
281281
public:
282282
class _LIBCPP_TEMPLATE_VIS handle;
283283

libcxx/include/__ranges/range_adaptor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ template <_RangeAdaptorClosure _Closure, _RangeAdaptorClosure _OtherClosure>
8585
# if _LIBCPP_STD_VER >= 23
8686
template <class _Tp>
8787
requires is_class_v<_Tp> && same_as<_Tp, remove_cv_t<_Tp>>
88-
class range_adaptor_closure : public __range_adaptor_closure<_Tp> {};
88+
class _LIBCPP_NO_SPECIALIZATIONS range_adaptor_closure : public __range_adaptor_closure<_Tp> {};
8989
# endif // _LIBCPP_STD_VER >= 23
9090

9191
} // namespace ranges

libcxx/include/__type_traits/add_cv_quals.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
_LIBCPP_BEGIN_NAMESPACE_STD
1919

2020
template <class _Tp>
21-
struct _LIBCPP_TEMPLATE_VIS add_const {
21+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS add_const {
2222
using type _LIBCPP_NODEBUG = const _Tp;
2323
};
2424

@@ -28,7 +28,7 @@ using add_const_t = typename add_const<_Tp>::type;
2828
#endif
2929

3030
template <class _Tp>
31-
struct _LIBCPP_TEMPLATE_VIS add_cv {
31+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS add_cv {
3232
using type _LIBCPP_NODEBUG = const volatile _Tp;
3333
};
3434

@@ -38,7 +38,7 @@ using add_cv_t = typename add_cv<_Tp>::type;
3838
#endif
3939

4040
template <class _Tp>
41-
struct _LIBCPP_TEMPLATE_VIS add_volatile {
41+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS add_volatile {
4242
using type _LIBCPP_NODEBUG = volatile _Tp;
4343
};
4444

libcxx/include/__type_traits/add_lvalue_reference.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ using __add_lvalue_reference_t = typename __add_lvalue_reference_impl<_Tp>::type
4040
#endif // __has_builtin(__add_lvalue_reference)
4141

4242
template <class _Tp>
43-
struct add_lvalue_reference {
43+
struct _LIBCPP_NO_SPECIALIZATIONS add_lvalue_reference {
4444
using type _LIBCPP_NODEBUG = __add_lvalue_reference_t<_Tp>;
4545
};
4646

libcxx/include/__type_traits/add_pointer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ using __add_pointer_t = typename __add_pointer_impl<_Tp>::type;
4141
#endif // !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS) && __has_builtin(__add_pointer)
4242

4343
template <class _Tp>
44-
struct add_pointer {
44+
struct _LIBCPP_NO_SPECIALIZATIONS add_pointer {
4545
using type _LIBCPP_NODEBUG = __add_pointer_t<_Tp>;
4646
};
4747

libcxx/include/__type_traits/add_rvalue_reference.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ using __add_rvalue_reference_t = typename __add_rvalue_reference_impl<_Tp>::type
4040
#endif // __has_builtin(__add_rvalue_reference)
4141

4242
template <class _Tp>
43-
struct add_rvalue_reference {
43+
struct _LIBCPP_NO_SPECIALIZATIONS add_rvalue_reference {
4444
using type = __add_rvalue_reference_t<_Tp>;
4545
};
4646

libcxx/include/__type_traits/aligned_storage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct __find_max_align<__type_list<_Head, _Tail...>, _Len>
6969
__select_align<_Len, _Head::value, __find_max_align<__type_list<_Tail...>, _Len>::value>::value> {};
7070

7171
template <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::value>
72-
struct _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_TEMPLATE_VIS aligned_storage {
72+
struct _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS aligned_storage {
7373
union _ALIGNAS(_Align) type {
7474
unsigned char __data[(_Len + _Align - 1) / _Align * _Align];
7575
};

libcxx/include/__type_traits/aligned_union.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct __static_max<_I0, _I1, _In...> {
3434
};
3535

3636
template <size_t _Len, class _Type0, class... _Types>
37-
struct _LIBCPP_DEPRECATED_IN_CXX23 aligned_union {
37+
struct _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_NO_SPECIALIZATIONS aligned_union {
3838
static const size_t alignment_value =
3939
__static_max<_LIBCPP_PREFERRED_ALIGNOF(_Type0), _LIBCPP_PREFERRED_ALIGNOF(_Types)...>::value;
4040
static const size_t __len = __static_max<_Len, sizeof(_Type0), sizeof(_Types)...>::value;

libcxx/include/__type_traits/alignment_of.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@
2020
_LIBCPP_BEGIN_NAMESPACE_STD
2121

2222
template <class _Tp>
23-
struct _LIBCPP_TEMPLATE_VIS alignment_of : public integral_constant<size_t, _LIBCPP_ALIGNOF(_Tp)> {};
23+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS alignment_of
24+
: public integral_constant<size_t, _LIBCPP_ALIGNOF(_Tp)> {};
2425

2526
#if _LIBCPP_STD_VER >= 17
2627
template <class _Tp>
27-
inline constexpr size_t alignment_of_v = _LIBCPP_ALIGNOF(_Tp);
28+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr size_t alignment_of_v = _LIBCPP_ALIGNOF(_Tp);
2829
#endif
2930

3031
_LIBCPP_END_NAMESPACE_STD

libcxx/include/__type_traits/conditional.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,17 @@ template <bool _Cond, class _IfRes, class _ElseRes>
3636
using _If _LIBCPP_NODEBUG = typename _IfImpl<_Cond>::template _Select<_IfRes, _ElseRes>;
3737

3838
template <bool _Bp, class _If, class _Then>
39-
struct _LIBCPP_TEMPLATE_VIS conditional {
39+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS conditional {
4040
using type _LIBCPP_NODEBUG = _If;
4141
};
42+
43+
_LIBCPP_DIAGNOSTIC_PUSH
44+
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Winvalid-specialization")
4245
template <class _If, class _Then>
4346
struct _LIBCPP_TEMPLATE_VIS conditional<false, _If, _Then> {
4447
using type _LIBCPP_NODEBUG = _Then;
4548
};
49+
_LIBCPP_DIAGNOSTIC_POP
4650

4751
#if _LIBCPP_STD_VER >= 14
4852
template <bool _Bp, class _IfRes, class _ElseRes>

libcxx/include/__type_traits/conjunction.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,19 @@ struct __all : _IsSame<__all_dummy<_Pred...>, __all_dummy<((void)_Pred, true)...
4747
#if _LIBCPP_STD_VER >= 17
4848

4949
template <class...>
50-
struct conjunction : true_type {};
50+
struct _LIBCPP_NO_SPECIALIZATIONS conjunction : true_type {};
5151

52+
_LIBCPP_DIAGNOSTIC_PUSH
53+
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Winvalid-specialization")
5254
template <class _Arg>
5355
struct conjunction<_Arg> : _Arg {};
5456

5557
template <class _Arg, class... _Args>
5658
struct conjunction<_Arg, _Args...> : conditional_t<!bool(_Arg::value), _Arg, conjunction<_Args...>> {};
59+
_LIBCPP_DIAGNOSTIC_POP
5760

5861
template <class... _Args>
59-
inline constexpr bool conjunction_v = conjunction<_Args...>::value;
62+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool conjunction_v = conjunction<_Args...>::value;
6063

6164
#endif // _LIBCPP_STD_VER >= 17
6265

libcxx/include/__type_traits/decay.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ template <class _Tp>
3030
using __decay_t _LIBCPP_NODEBUG = __decay(_Tp);
3131

3232
template <class _Tp>
33-
struct decay {
33+
struct _LIBCPP_NO_SPECIALIZATIONS decay {
3434
using type _LIBCPP_NODEBUG = __decay_t<_Tp>;
3535
};
3636

libcxx/include/__type_traits/disjunction.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ using _Or _LIBCPP_NODEBUG = typename _OrImpl<sizeof...(_Args) != 0>::template _R
4646
#if _LIBCPP_STD_VER >= 17
4747

4848
template <class... _Args>
49-
struct disjunction : _Or<_Args...> {};
49+
struct _LIBCPP_NO_SPECIALIZATIONS disjunction : _Or<_Args...> {};
5050

5151
template <class... _Args>
52-
inline constexpr bool disjunction_v = _Or<_Args...>::value;
52+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool disjunction_v = _Or<_Args...>::value;
5353

5454
#endif // _LIBCPP_STD_VER >= 17
5555

libcxx/include/__type_traits/enable_if.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,15 @@
1818
_LIBCPP_BEGIN_NAMESPACE_STD
1919

2020
template <bool, class _Tp = void>
21-
struct _LIBCPP_TEMPLATE_VIS enable_if {};
21+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS enable_if {};
22+
23+
_LIBCPP_DIAGNOSTIC_PUSH
24+
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Winvalid-specialization")
2225
template <class _Tp>
2326
struct _LIBCPP_TEMPLATE_VIS enable_if<true, _Tp> {
2427
typedef _Tp type;
2528
};
29+
_LIBCPP_DIAGNOSTIC_POP
2630

2731
template <bool _Bp, class _Tp = void>
2832
using __enable_if_t _LIBCPP_NODEBUG = typename enable_if<_Bp, _Tp>::type;

libcxx/include/__type_traits/extent.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2222
#if __has_builtin(__array_extent)
2323

2424
template <class _Tp, size_t _Dim = 0>
25-
struct _LIBCPP_TEMPLATE_VIS extent : integral_constant<size_t, __array_extent(_Tp, _Dim)> {};
25+
struct _LIBCPP_NO_SPECIALIZATIONS _LIBCPP_TEMPLATE_VIS extent : integral_constant<size_t, __array_extent(_Tp, _Dim)> {};
2626

2727
# if _LIBCPP_STD_VER >= 17
2828
template <class _Tp, unsigned _Ip = 0>
29-
inline constexpr size_t extent_v = __array_extent(_Tp, _Ip);
29+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr size_t extent_v = __array_extent(_Tp, _Ip);
3030
# endif
3131

3232
#else // __has_builtin(__array_extent)

libcxx/include/__type_traits/has_unique_object_representation.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2222
#if _LIBCPP_STD_VER >= 17
2323

2424
template <class _Tp>
25-
struct _LIBCPP_TEMPLATE_VIS has_unique_object_representations
25+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS has_unique_object_representations
2626
// TODO: We work around a Clang and GCC bug in __has_unique_object_representations by using remove_all_extents
2727
// even though it should not be necessary. This was reported to the compilers:
2828
// - Clang: https://github.com/llvm/llvm-project/issues/95311
@@ -31,7 +31,8 @@ struct _LIBCPP_TEMPLATE_VIS has_unique_object_representations
3131
: public integral_constant<bool, __has_unique_object_representations(remove_all_extents_t<_Tp>)> {};
3232

3333
template <class _Tp>
34-
inline constexpr bool has_unique_object_representations_v = __has_unique_object_representations(_Tp);
34+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool has_unique_object_representations_v =
35+
__has_unique_object_representations(_Tp);
3536

3637
#endif
3738

libcxx/include/__type_traits/has_virtual_destructor.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@
1919
_LIBCPP_BEGIN_NAMESPACE_STD
2020

2121
template <class _Tp>
22-
struct _LIBCPP_TEMPLATE_VIS has_virtual_destructor : public integral_constant<bool, __has_virtual_destructor(_Tp)> {};
22+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS has_virtual_destructor
23+
: public integral_constant<bool, __has_virtual_destructor(_Tp)> {};
2324

2425
#if _LIBCPP_STD_VER >= 17
2526
template <class _Tp>
26-
inline constexpr bool has_virtual_destructor_v = __has_virtual_destructor(_Tp);
27+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool has_virtual_destructor_v = __has_virtual_destructor(_Tp);
2728
#endif
2829

2930
_LIBCPP_END_NAMESPACE_STD

libcxx/include/__type_traits/integral_constant.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
_LIBCPP_BEGIN_NAMESPACE_STD
1919

2020
template <class _Tp, _Tp __v>
21-
struct _LIBCPP_TEMPLATE_VIS integral_constant {
21+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS integral_constant {
2222
static inline _LIBCPP_CONSTEXPR const _Tp value = __v;
2323
typedef _Tp value_type;
2424
typedef integral_constant type;

libcxx/include/__type_traits/invoke.h

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -231,35 +231,38 @@ struct __invoke_void_return_wrapper<_Ret, true> {
231231
// is_invocable
232232

233233
template <class _Fn, class... _Args>
234-
struct _LIBCPP_TEMPLATE_VIS is_invocable : integral_constant<bool, __invokable<_Fn, _Args...>::value> {};
234+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS is_invocable
235+
: integral_constant<bool, __invokable<_Fn, _Args...>::value> {};
235236

236237
template <class _Ret, class _Fn, class... _Args>
237-
struct _LIBCPP_TEMPLATE_VIS is_invocable_r : integral_constant<bool, __invokable_r<_Ret, _Fn, _Args...>::value> {};
238+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS is_invocable_r
239+
: integral_constant<bool, __invokable_r<_Ret, _Fn, _Args...>::value> {};
238240

239241
template <class _Fn, class... _Args>
240-
inline constexpr bool is_invocable_v = is_invocable<_Fn, _Args...>::value;
242+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_invocable_v = is_invocable<_Fn, _Args...>::value;
241243

242244
template <class _Ret, class _Fn, class... _Args>
243-
inline constexpr bool is_invocable_r_v = is_invocable_r<_Ret, _Fn, _Args...>::value;
245+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_invocable_r_v = is_invocable_r<_Ret, _Fn, _Args...>::value;
244246

245247
// is_nothrow_invocable
246248

247249
template <class _Fn, class... _Args>
248-
struct _LIBCPP_TEMPLATE_VIS is_nothrow_invocable : integral_constant<bool, __nothrow_invokable<_Fn, _Args...>::value> {
249-
};
250+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS is_nothrow_invocable
251+
: integral_constant<bool, __nothrow_invokable<_Fn, _Args...>::value> {};
250252

251253
template <class _Ret, class _Fn, class... _Args>
252-
struct _LIBCPP_TEMPLATE_VIS is_nothrow_invocable_r
254+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS is_nothrow_invocable_r
253255
: integral_constant<bool, __nothrow_invokable_r<_Ret, _Fn, _Args...>::value> {};
254256

255257
template <class _Fn, class... _Args>
256-
inline constexpr bool is_nothrow_invocable_v = is_nothrow_invocable<_Fn, _Args...>::value;
258+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_nothrow_invocable_v = is_nothrow_invocable<_Fn, _Args...>::value;
257259

258260
template <class _Ret, class _Fn, class... _Args>
259-
inline constexpr bool is_nothrow_invocable_r_v = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
261+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_nothrow_invocable_r_v =
262+
is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
260263

261264
template <class _Fn, class... _Args>
262-
struct _LIBCPP_TEMPLATE_VIS invoke_result : __invoke_of<_Fn, _Args...> {};
265+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS invoke_result : __invoke_of<_Fn, _Args...> {};
263266

264267
template <class _Fn, class... _Args>
265268
using invoke_result_t = typename invoke_result<_Fn, _Args...>::type;

libcxx/include/__type_traits/is_abstract.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@
1919
_LIBCPP_BEGIN_NAMESPACE_STD
2020

2121
template <class _Tp>
22-
struct _LIBCPP_TEMPLATE_VIS is_abstract : public integral_constant<bool, __is_abstract(_Tp)> {};
22+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS is_abstract
23+
: public integral_constant<bool, __is_abstract(_Tp)> {};
2324

2425
#if _LIBCPP_STD_VER >= 17
2526
template <class _Tp>
26-
inline constexpr bool is_abstract_v = __is_abstract(_Tp);
27+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_abstract_v = __is_abstract(_Tp);
2728
#endif
2829

2930
_LIBCPP_END_NAMESPACE_STD

libcxx/include/__type_traits/is_aggregate.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2121
#if _LIBCPP_STD_VER >= 17
2222

2323
template <class _Tp>
24-
struct _LIBCPP_TEMPLATE_VIS is_aggregate : public integral_constant<bool, __is_aggregate(_Tp)> {};
24+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS is_aggregate
25+
: public integral_constant<bool, __is_aggregate(_Tp)> {};
2526

2627
template <class _Tp>
27-
inline constexpr bool is_aggregate_v = __is_aggregate(_Tp);
28+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_aggregate_v = __is_aggregate(_Tp);
2829

2930
#endif // _LIBCPP_STD_VER >= 17
3031

libcxx/include/__type_traits/is_arithmetic.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
_LIBCPP_BEGIN_NAMESPACE_STD
2222

2323
template <class _Tp>
24-
struct _LIBCPP_TEMPLATE_VIS is_arithmetic
24+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS is_arithmetic
2525
: public integral_constant<bool, is_integral<_Tp>::value || is_floating_point<_Tp>::value> {};
2626

2727
#if _LIBCPP_STD_VER >= 17
2828
template <class _Tp>
29-
inline constexpr bool is_arithmetic_v = is_arithmetic<_Tp>::value;
29+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_arithmetic_v = is_arithmetic<_Tp>::value;
3030
#endif
3131

3232
_LIBCPP_END_NAMESPACE_STD

libcxx/include/__type_traits/is_array.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2323
(!defined(_LIBCPP_COMPILER_CLANG_BASED) || (defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1900))
2424

2525
template <class _Tp>
26-
struct _LIBCPP_TEMPLATE_VIS is_array : _BoolConstant<__is_array(_Tp)> {};
26+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS is_array : _BoolConstant<__is_array(_Tp)> {};
2727

2828
# if _LIBCPP_STD_VER >= 17
2929
template <class _Tp>
30-
inline constexpr bool is_array_v = __is_array(_Tp);
30+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_array_v = __is_array(_Tp);
3131
# endif
3232

3333
#else

0 commit comments

Comments
 (0)