Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dd147a8

Browse files
committed
In libc++'s type_traits header, avoid warnings (activated by our use of
-Wsystem-headers) about potential keyword compatibility problems, by adding a __libcpp prefix to the applicable identifiers. Upstream is still debating about this, but we need it now, to be able to import clang 3.4. MFC after: 3 days
1 parent c5923c0 commit dd147a8

File tree

1 file changed

+46
-46
lines changed

1 file changed

+46
-46
lines changed

contrib/libc++/include/type_traits

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -280,53 +280,53 @@ template <class _Tp> using remove_cv_t = typename remove_cv<_Tp>::type;
280280

281281
// is_void
282282

283-
template <class _Tp> struct __is_void : public false_type {};
284-
template <> struct __is_void<void> : public true_type {};
283+
template <class _Tp> struct __libcpp_is_void : public false_type {};
284+
template <> struct __libcpp_is_void<void> : public true_type {};
285285

286286
template <class _Tp> struct _LIBCPP_TYPE_VIS is_void
287-
: public __is_void<typename remove_cv<_Tp>::type> {};
287+
: public __libcpp_is_void<typename remove_cv<_Tp>::type> {};
288288

289289
// __is_nullptr_t
290290

291-
template <class _Tp> struct ____is_nullptr_t : public false_type {};
292-
template <> struct ____is_nullptr_t<nullptr_t> : public true_type {};
291+
template <class _Tp> struct __libcpp___is_nullptr : public false_type {};
292+
template <> struct __libcpp___is_nullptr<nullptr_t> : public true_type {};
293293

294294
template <class _Tp> struct _LIBCPP_TYPE_VIS __is_nullptr_t
295-
: public ____is_nullptr_t<typename remove_cv<_Tp>::type> {};
295+
: public __libcpp___is_nullptr<typename remove_cv<_Tp>::type> {};
296296

297297
// is_integral
298298

299-
template <class _Tp> struct __is_integral : public false_type {};
300-
template <> struct __is_integral<bool> : public true_type {};
301-
template <> struct __is_integral<char> : public true_type {};
302-
template <> struct __is_integral<signed char> : public true_type {};
303-
template <> struct __is_integral<unsigned char> : public true_type {};
304-
template <> struct __is_integral<wchar_t> : public true_type {};
299+
template <class _Tp> struct __libcpp_is_integral : public false_type {};
300+
template <> struct __libcpp_is_integral<bool> : public true_type {};
301+
template <> struct __libcpp_is_integral<char> : public true_type {};
302+
template <> struct __libcpp_is_integral<signed char> : public true_type {};
303+
template <> struct __libcpp_is_integral<unsigned char> : public true_type {};
304+
template <> struct __libcpp_is_integral<wchar_t> : public true_type {};
305305
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
306-
template <> struct __is_integral<char16_t> : public true_type {};
307-
template <> struct __is_integral<char32_t> : public true_type {};
306+
template <> struct __libcpp_is_integral<char16_t> : public true_type {};
307+
template <> struct __libcpp_is_integral<char32_t> : public true_type {};
308308
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
309-
template <> struct __is_integral<short> : public true_type {};
310-
template <> struct __is_integral<unsigned short> : public true_type {};
311-
template <> struct __is_integral<int> : public true_type {};
312-
template <> struct __is_integral<unsigned int> : public true_type {};
313-
template <> struct __is_integral<long> : public true_type {};
314-
template <> struct __is_integral<unsigned long> : public true_type {};
315-
template <> struct __is_integral<long long> : public true_type {};
316-
template <> struct __is_integral<unsigned long long> : public true_type {};
309+
template <> struct __libcpp_is_integral<short> : public true_type {};
310+
template <> struct __libcpp_is_integral<unsigned short> : public true_type {};
311+
template <> struct __libcpp_is_integral<int> : public true_type {};
312+
template <> struct __libcpp_is_integral<unsigned int> : public true_type {};
313+
template <> struct __libcpp_is_integral<long> : public true_type {};
314+
template <> struct __libcpp_is_integral<unsigned long> : public true_type {};
315+
template <> struct __libcpp_is_integral<long long> : public true_type {};
316+
template <> struct __libcpp_is_integral<unsigned long long> : public true_type {};
317317

318318
template <class _Tp> struct _LIBCPP_TYPE_VIS is_integral
319-
: public __is_integral<typename remove_cv<_Tp>::type> {};
319+
: public __libcpp_is_integral<typename remove_cv<_Tp>::type> {};
320320

321321
// is_floating_point
322322

323-
template <class _Tp> struct __is_floating_point : public false_type {};
324-
template <> struct __is_floating_point<float> : public true_type {};
325-
template <> struct __is_floating_point<double> : public true_type {};
326-
template <> struct __is_floating_point<long double> : public true_type {};
323+
template <class _Tp> struct __libcpp_is_floating_point : public false_type {};
324+
template <> struct __libcpp_is_floating_point<float> : public true_type {};
325+
template <> struct __libcpp_is_floating_point<double> : public true_type {};
326+
template <> struct __libcpp_is_floating_point<long double> : public true_type {};
327327

328328
template <class _Tp> struct _LIBCPP_TYPE_VIS is_floating_point
329-
: public __is_floating_point<typename remove_cv<_Tp>::type> {};
329+
: public __libcpp_is_floating_point<typename remove_cv<_Tp>::type> {};
330330

331331
// is_array
332332

@@ -339,11 +339,11 @@ template <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS is_array<_Tp[_Np]>
339339

340340
// is_pointer
341341

342-
template <class _Tp> struct __is_pointer : public false_type {};
343-
template <class _Tp> struct __is_pointer<_Tp*> : public true_type {};
342+
template <class _Tp> struct __libcpp_is_pointer : public false_type {};
343+
template <class _Tp> struct __libcpp_is_pointer<_Tp*> : public true_type {};
344344

345345
template <class _Tp> struct _LIBCPP_TYPE_VIS is_pointer
346-
: public __is_pointer<typename remove_cv<_Tp>::type> {};
346+
: public __libcpp_is_pointer<typename remove_cv<_Tp>::type> {};
347347

348348
// is_reference
349349

@@ -419,29 +419,29 @@ template <class _Tp, bool = is_class<_Tp>::value ||
419419
is_void<_Tp>::value ||
420420
is_reference<_Tp>::value ||
421421
is_same<_Tp, nullptr_t>::value >
422-
struct __is_function
422+
struct __libcpp_is_function
423423
: public integral_constant<bool, sizeof(__is_function_imp::__test<_Tp>(__is_function_imp::__source<_Tp>())) == 1>
424424
{};
425-
template <class _Tp> struct __is_function<_Tp, true> : public false_type {};
425+
template <class _Tp> struct __libcpp_is_function<_Tp, true> : public false_type {};
426426

427427
template <class _Tp> struct _LIBCPP_TYPE_VIS is_function
428-
: public __is_function<_Tp> {};
428+
: public __libcpp_is_function<_Tp> {};
429429

430430
// is_member_function_pointer
431431

432-
template <class _Tp> struct __is_member_function_pointer : public false_type {};
433-
template <class _Tp, class _Up> struct __is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {};
432+
template <class _Tp> struct __libcpp_is_member_function_pointer : public false_type {};
433+
template <class _Tp, class _Up> struct __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {};
434434

435435
template <class _Tp> struct _LIBCPP_TYPE_VIS is_member_function_pointer
436-
: public __is_member_function_pointer<typename remove_cv<_Tp>::type> {};
436+
: public __libcpp_is_member_function_pointer<typename remove_cv<_Tp>::type> {};
437437

438438
// is_member_pointer
439439

440-
template <class _Tp> struct __is_member_pointer : public false_type {};
441-
template <class _Tp, class _Up> struct __is_member_pointer<_Tp _Up::*> : public true_type {};
440+
template <class _Tp> struct __libcpp_is_member_pointer : public false_type {};
441+
template <class _Tp, class _Up> struct __libcpp_is_member_pointer<_Tp _Up::*> : public true_type {};
442442

443443
template <class _Tp> struct _LIBCPP_TYPE_VIS is_member_pointer
444-
: public __is_member_pointer<typename remove_cv<_Tp>::type> {};
444+
: public __libcpp_is_member_pointer<typename remove_cv<_Tp>::type> {};
445445

446446
// is_member_object_pointer
447447

@@ -640,11 +640,11 @@ template <class _Tp>
640640
struct ___is_signed<_Tp, false> : public true_type {}; // floating point
641641

642642
template <class _Tp, bool = is_arithmetic<_Tp>::value>
643-
struct __is_signed : public ___is_signed<_Tp> {};
643+
struct __libcpp_is_signed : public ___is_signed<_Tp> {};
644644

645-
template <class _Tp> struct __is_signed<_Tp, false> : public false_type {};
645+
template <class _Tp> struct __libcpp_is_signed<_Tp, false> : public false_type {};
646646

647-
template <class _Tp> struct _LIBCPP_TYPE_VIS is_signed : public __is_signed<_Tp> {};
647+
template <class _Tp> struct _LIBCPP_TYPE_VIS is_signed : public __libcpp_is_signed<_Tp> {};
648648

649649
// is_unsigned
650650

@@ -655,11 +655,11 @@ template <class _Tp>
655655
struct ___is_unsigned<_Tp, false> : public false_type {}; // floating point
656656

657657
template <class _Tp, bool = is_arithmetic<_Tp>::value>
658-
struct __is_unsigned : public ___is_unsigned<_Tp> {};
658+
struct __libcpp_is_unsigned : public ___is_unsigned<_Tp> {};
659659

660-
template <class _Tp> struct __is_unsigned<_Tp, false> : public false_type {};
660+
template <class _Tp> struct __libcpp_is_unsigned<_Tp, false> : public false_type {};
661661

662-
template <class _Tp> struct _LIBCPP_TYPE_VIS is_unsigned : public __is_unsigned<_Tp> {};
662+
template <class _Tp> struct _LIBCPP_TYPE_VIS is_unsigned : public __libcpp_is_unsigned<_Tp> {};
663663

664664
// rank
665665

0 commit comments

Comments
 (0)