[libc++] Remove some workarounds for unsupported GCC and Clang versions
There is a lot more we can do, in particular in <type_traits>, but this
removes some workarounds that were gated on checking a specific compiler
version.
Differential Revision: https://reviews.llvm.org/D108923
NOKEYCHECK=True
GitOrigin-RevId: a4cb5aefd545104e52139d9c3ba6c51165a8dabe
diff --git a/include/string b/include/string
index 543234e..1577765 100644
--- a/include/string
+++ b/include/string
@@ -2373,7 +2373,7 @@
basic_string<_CharT, _Traits, _Allocator>::assign(const value_type* __s, size_type __n)
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::assign received nullptr");
- return (_LIBCPP_BUILTIN_CONSTANT_P(__n) && __n < __min_cap)
+ return (__builtin_constant_p(__n) && __n < __min_cap)
? __assign_short(__s, __n)
: __assign_external(__s, __n);
}
@@ -2578,7 +2578,7 @@
basic_string<_CharT, _Traits, _Allocator>::assign(const value_type* __s)
{
_LIBCPP_ASSERT(__s != nullptr, "string::assign received nullptr");
- return _LIBCPP_BUILTIN_CONSTANT_P(*__s)
+ return __builtin_constant_p(*__s)
? (traits_type::length(__s) < __min_cap
? __assign_short(__s, traits_type::length(__s))
: __assign_external(__s, traits_type::length(__s)))