Skip to content

Commit ced8a0c

Browse files
committed
[libc++] Use [[clang::no_specializations]] to diagnose invalid user specializations
1 parent 976f3a0 commit ced8a0c

File tree

89 files changed

+532
-196
lines changed

Some content is hidden

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

89 files changed

+532
-196
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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,12 @@ typedef __char32_t char32_t;
11721172

11731173
# define _LIBCPP_NODEBUG [[__gnu__::__nodebug__]]
11741174

1175+
# if __has_cpp_attribute(_Clang::__no_specializations__)
1176+
# define _LIBCPP_NO_SPECIALIZATIONS [[_Clang::__no_specializations__]]
1177+
# else
1178+
# define _LIBCPP_NO_SPECIALIZATIONS
1179+
# endif
1180+
11751181
# if __has_attribute(__standalone_debug__)
11761182
# define _LIBCPP_STANDALONE_DEBUG __attribute__((__standalone_debug__))
11771183
# else

libcxx/include/__cxx03/__type_traits/add_const.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_const {
21+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DIAGNOSE_SPECIALIZATIONS add_const {
2222
typedef _LIBCPP_NODEBUG const _Tp type;
2323
};
2424

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/conjunction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ template <class _Arg, class... _Args>
5656
struct conjunction<_Arg, _Args...> : conditional_t<!bool(_Arg::value), _Arg, conjunction<_Args...>> {};
5757

5858
template <class... _Args>
59-
inline constexpr bool conjunction_v = conjunction<_Args...>::value;
59+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool conjunction_v = conjunction<_Args...>::value;
6060

6161
#endif // _LIBCPP_STD_VER >= 17
6262

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/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
@@ -230,35 +230,38 @@ struct __invoke_void_return_wrapper<_Ret, true> {
230230
// is_invocable
231231

232232
template <class _Fn, class... _Args>
233-
struct _LIBCPP_TEMPLATE_VIS is_invocable : integral_constant<bool, __invokable<_Fn, _Args...>::value> {};
233+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS is_invocable
234+
: integral_constant<bool, __invokable<_Fn, _Args...>::value> {};
234235

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

238240
template <class _Fn, class... _Args>
239-
inline constexpr bool is_invocable_v = is_invocable<_Fn, _Args...>::value;
241+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_invocable_v = is_invocable<_Fn, _Args...>::value;
240242

241243
template <class _Ret, class _Fn, class... _Args>
242-
inline constexpr bool is_invocable_r_v = is_invocable_r<_Ret, _Fn, _Args...>::value;
244+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_invocable_r_v = is_invocable_r<_Ret, _Fn, _Args...>::value;
243245

244246
// is_nothrow_invocable
245247

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

250252
template <class _Ret, class _Fn, class... _Args>
251-
struct _LIBCPP_TEMPLATE_VIS is_nothrow_invocable_r
253+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS is_nothrow_invocable_r
252254
: integral_constant<bool, __nothrow_invokable_r<_Ret, _Fn, _Args...>::value> {};
253255

254256
template <class _Fn, class... _Args>
255-
inline constexpr bool is_nothrow_invocable_v = is_nothrow_invocable<_Fn, _Args...>::value;
257+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_nothrow_invocable_v = is_nothrow_invocable<_Fn, _Args...>::value;
256258

257259
template <class _Ret, class _Fn, class... _Args>
258-
inline constexpr bool is_nothrow_invocable_r_v = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
260+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_nothrow_invocable_r_v =
261+
is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
259262

260263
template <class _Fn, class... _Args>
261-
struct _LIBCPP_TEMPLATE_VIS invoke_result : __invoke_of<_Fn, _Args...> {};
264+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS invoke_result : __invoke_of<_Fn, _Args...> {};
262265

263266
template <class _Fn, class... _Args>
264267
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

libcxx/include/__type_traits/is_assignable.h

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

2323
template <class _Tp, class _Up>
24-
struct _LIBCPP_TEMPLATE_VIS is_assignable : _BoolConstant<__is_assignable(_Tp, _Up)> {};
24+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS is_assignable : _BoolConstant<__is_assignable(_Tp, _Up)> {};
2525

2626
#if _LIBCPP_STD_VER >= 17
2727
template <class _Tp, class _Arg>
28-
inline constexpr bool is_assignable_v = __is_assignable(_Tp, _Arg);
28+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_assignable_v = __is_assignable(_Tp, _Arg);
2929
#endif
3030

3131
template <class _Tp>
32-
struct _LIBCPP_TEMPLATE_VIS is_copy_assignable
32+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS is_copy_assignable
3333
: public integral_constant<bool,
3434
__is_assignable(__add_lvalue_reference_t<_Tp>, __add_lvalue_reference_t<const _Tp>)> {};
3535

3636
#if _LIBCPP_STD_VER >= 17
3737
template <class _Tp>
38-
inline constexpr bool is_copy_assignable_v = is_copy_assignable<_Tp>::value;
38+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_copy_assignable_v = is_copy_assignable<_Tp>::value;
3939
#endif
4040

4141
template <class _Tp>
42-
struct _LIBCPP_TEMPLATE_VIS is_move_assignable
42+
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS is_move_assignable
4343
: public integral_constant<bool, __is_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> {};
4444

4545
#if _LIBCPP_STD_VER >= 17
4646
template <class _Tp>
47-
inline constexpr bool is_move_assignable_v = is_move_assignable<_Tp>::value;
47+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_move_assignable_v = is_move_assignable<_Tp>::value;
4848
#endif
4949

5050
_LIBCPP_END_NAMESPACE_STD

0 commit comments

Comments
 (0)