Skip to content

Commit 15071d2

Browse files
committed
[libc++] Remove _LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS
All supported compilers have implemented __has_unique_object_representations for a while, so it's reasonable to remove the workaround. Differential Revision: https://reviews.llvm.org/D107834
1 parent 7be03cc commit 15071d2

File tree

6 files changed

+32
-77
lines changed

6 files changed

+32
-77
lines changed

libcxx/include/__config

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -510,10 +510,6 @@ typedef __char32_t char32_t;
510510
#define _LIBCPP_COMPILER_HAS_BUILTIN_CONSTANT_P
511511
#endif
512512

513-
#if !__is_identifier(__has_unique_object_representations)
514-
#define _LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS
515-
#endif
516-
517513
#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))
518514

519515
// Literal operators ""d and ""y are supported starting with LLVM Clang 8 and AppleClang 10.0.1
@@ -552,7 +548,6 @@ typedef __char32_t char32_t;
552548
#if _GNUC_VER >= 700
553549
#define _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER
554550
#define _LIBCPP_COMPILER_HAS_BUILTIN_CONSTANT_P
555-
#define _LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS
556551
#endif
557552

558553
#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))

libcxx/include/type_traits

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1914,7 +1914,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool has_virtual_destructor_v
19141914

19151915
// has_unique_object_representations
19161916

1917-
#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS)
1917+
#if _LIBCPP_STD_VER > 14
19181918

19191919
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS has_unique_object_representations
19201920
: public integral_constant<bool,

libcxx/include/version

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,7 @@ __cpp_lib_void_t 201411L <type_traits>
222222
# endif
223223
# define __cpp_lib_gcd_lcm 201606L
224224
// # define __cpp_lib_hardware_interference_size 201703L
225-
# if defined(_LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS)
226-
# define __cpp_lib_has_unique_object_representations 201606L
227-
# endif
225+
# define __cpp_lib_has_unique_object_representations 201606L
228226
# define __cpp_lib_hypot 201603L
229227
# define __cpp_lib_incomplete_container_elements 201505L
230228
# define __cpp_lib_invoke 201411L

libcxx/test/std/language.support/support.limits/support.limits.general/type_traits.version.pass.cpp

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -233,17 +233,11 @@
233233
# error "__cpp_lib_bounded_array_traits should not be defined before c++20"
234234
# endif
235235

236-
# if TEST_HAS_BUILTIN_IDENTIFIER(__has_unique_object_representations) || TEST_GCC_VER >= 700
237-
# ifndef __cpp_lib_has_unique_object_representations
238-
# error "__cpp_lib_has_unique_object_representations should be defined in c++17"
239-
# endif
240-
# if __cpp_lib_has_unique_object_representations != 201606L
241-
# error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++17"
242-
# endif
243-
# else
244-
# ifdef __cpp_lib_has_unique_object_representations
245-
# error "__cpp_lib_has_unique_object_representations should not be defined when TEST_HAS_BUILTIN_IDENTIFIER(__has_unique_object_representations) || TEST_GCC_VER >= 700 is not defined!"
246-
# endif
236+
# ifndef __cpp_lib_has_unique_object_representations
237+
# error "__cpp_lib_has_unique_object_representations should be defined in c++17"
238+
# endif
239+
# if __cpp_lib_has_unique_object_representations != 201606L
240+
# error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++17"
247241
# endif
248242

249243
# ifndef __cpp_lib_integral_constant_callable
@@ -363,17 +357,11 @@
363357
# error "__cpp_lib_bounded_array_traits should have the value 201902L in c++20"
364358
# endif
365359

366-
# if TEST_HAS_BUILTIN_IDENTIFIER(__has_unique_object_representations) || TEST_GCC_VER >= 700
367-
# ifndef __cpp_lib_has_unique_object_representations
368-
# error "__cpp_lib_has_unique_object_representations should be defined in c++20"
369-
# endif
370-
# if __cpp_lib_has_unique_object_representations != 201606L
371-
# error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++20"
372-
# endif
373-
# else
374-
# ifdef __cpp_lib_has_unique_object_representations
375-
# error "__cpp_lib_has_unique_object_representations should not be defined when TEST_HAS_BUILTIN_IDENTIFIER(__has_unique_object_representations) || TEST_GCC_VER >= 700 is not defined!"
376-
# endif
360+
# ifndef __cpp_lib_has_unique_object_representations
361+
# error "__cpp_lib_has_unique_object_representations should be defined in c++20"
362+
# endif
363+
# if __cpp_lib_has_unique_object_representations != 201606L
364+
# error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++20"
377365
# endif
378366

379367
# ifndef __cpp_lib_integral_constant_callable
@@ -520,17 +508,11 @@
520508
# error "__cpp_lib_bounded_array_traits should have the value 201902L in c++2b"
521509
# endif
522510

523-
# if TEST_HAS_BUILTIN_IDENTIFIER(__has_unique_object_representations) || TEST_GCC_VER >= 700
524-
# ifndef __cpp_lib_has_unique_object_representations
525-
# error "__cpp_lib_has_unique_object_representations should be defined in c++2b"
526-
# endif
527-
# if __cpp_lib_has_unique_object_representations != 201606L
528-
# error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++2b"
529-
# endif
530-
# else
531-
# ifdef __cpp_lib_has_unique_object_representations
532-
# error "__cpp_lib_has_unique_object_representations should not be defined when TEST_HAS_BUILTIN_IDENTIFIER(__has_unique_object_representations) || TEST_GCC_VER >= 700 is not defined!"
533-
# endif
511+
# ifndef __cpp_lib_has_unique_object_representations
512+
# error "__cpp_lib_has_unique_object_representations should be defined in c++2b"
513+
# endif
514+
# if __cpp_lib_has_unique_object_representations != 201606L
515+
# error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++2b"
534516
# endif
535517

536518
# ifndef __cpp_lib_integral_constant_callable

libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,17 +1600,11 @@
16001600
# endif
16011601
# endif
16021602

1603-
# if TEST_HAS_BUILTIN_IDENTIFIER(__has_unique_object_representations) || TEST_GCC_VER >= 700
1604-
# ifndef __cpp_lib_has_unique_object_representations
1605-
# error "__cpp_lib_has_unique_object_representations should be defined in c++17"
1606-
# endif
1607-
# if __cpp_lib_has_unique_object_representations != 201606L
1608-
# error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++17"
1609-
# endif
1610-
# else
1611-
# ifdef __cpp_lib_has_unique_object_representations
1612-
# error "__cpp_lib_has_unique_object_representations should not be defined when TEST_HAS_BUILTIN_IDENTIFIER(__has_unique_object_representations) || TEST_GCC_VER >= 700 is not defined!"
1613-
# endif
1603+
# ifndef __cpp_lib_has_unique_object_representations
1604+
# error "__cpp_lib_has_unique_object_representations should be defined in c++17"
1605+
# endif
1606+
# if __cpp_lib_has_unique_object_representations != 201606L
1607+
# error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++17"
16141608
# endif
16151609

16161610
# ifndef __cpp_lib_hypot
@@ -2613,17 +2607,11 @@
26132607
# endif
26142608
# endif
26152609

2616-
# if TEST_HAS_BUILTIN_IDENTIFIER(__has_unique_object_representations) || TEST_GCC_VER >= 700
2617-
# ifndef __cpp_lib_has_unique_object_representations
2618-
# error "__cpp_lib_has_unique_object_representations should be defined in c++20"
2619-
# endif
2620-
# if __cpp_lib_has_unique_object_representations != 201606L
2621-
# error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++20"
2622-
# endif
2623-
# else
2624-
# ifdef __cpp_lib_has_unique_object_representations
2625-
# error "__cpp_lib_has_unique_object_representations should not be defined when TEST_HAS_BUILTIN_IDENTIFIER(__has_unique_object_representations) || TEST_GCC_VER >= 700 is not defined!"
2626-
# endif
2610+
# ifndef __cpp_lib_has_unique_object_representations
2611+
# error "__cpp_lib_has_unique_object_representations should be defined in c++20"
2612+
# endif
2613+
# if __cpp_lib_has_unique_object_representations != 201606L
2614+
# error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++20"
26272615
# endif
26282616

26292617
# ifndef __cpp_lib_hypot
@@ -3782,17 +3770,11 @@
37823770
# endif
37833771
# endif
37843772

3785-
# if TEST_HAS_BUILTIN_IDENTIFIER(__has_unique_object_representations) || TEST_GCC_VER >= 700
3786-
# ifndef __cpp_lib_has_unique_object_representations
3787-
# error "__cpp_lib_has_unique_object_representations should be defined in c++2b"
3788-
# endif
3789-
# if __cpp_lib_has_unique_object_representations != 201606L
3790-
# error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++2b"
3791-
# endif
3792-
# else
3793-
# ifdef __cpp_lib_has_unique_object_representations
3794-
# error "__cpp_lib_has_unique_object_representations should not be defined when TEST_HAS_BUILTIN_IDENTIFIER(__has_unique_object_representations) || TEST_GCC_VER >= 700 is not defined!"
3795-
# endif
3773+
# ifndef __cpp_lib_has_unique_object_representations
3774+
# error "__cpp_lib_has_unique_object_representations should be defined in c++2b"
3775+
# endif
3776+
# if __cpp_lib_has_unique_object_representations != 201606L
3777+
# error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++2b"
37963778
# endif
37973779

37983780
# ifndef __cpp_lib_hypot

libcxx/utils/generate_feature_test_macro_components.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,6 @@ def add_version_header(tc):
323323
"name": "__cpp_lib_has_unique_object_representations",
324324
"values": { "c++17": 201606 },
325325
"headers": ["type_traits"],
326-
"test_suite_guard": "TEST_HAS_BUILTIN_IDENTIFIER(__has_unique_object_representations) || TEST_GCC_VER >= 700",
327-
"libcxx_guard": "defined(_LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS)",
328326
}, {
329327
"name": "__cpp_lib_hypot",
330328
"values": { "c++17": 201603 },

0 commit comments

Comments
 (0)