mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-28 05:36:06 +00:00
[libc++] Qualifies intptr_t and uintptr_t.
This has been done using the following command find libcxx/test -type f -exec perl -pi -e 's|^([^/]+?)((?<!::)(?<!::u)u?intptr_t)|\1std::\2|' \{} \; The std module doesn't export declarations in the global namespaace. This is a preparation for that module. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D146643
This commit is contained in:
parent
e73186796d
commit
d59a43fe2a
@ -64,8 +64,8 @@ int main(int, char**)
|
||||
static_assert((std::is_same<std::atomic<char32_t>, std::atomic_char32_t>::value), "");
|
||||
|
||||
// Added by LWG 2441
|
||||
static_assert((std::is_same<std::atomic<intptr_t>, std::atomic_intptr_t>::value), "");
|
||||
static_assert((std::is_same<std::atomic<uintptr_t>, std::atomic_uintptr_t>::value), "");
|
||||
static_assert((std::is_same<std::atomic<std::intptr_t>, std::atomic_intptr_t>::value), "");
|
||||
static_assert((std::is_same<std::atomic<std::uintptr_t>, std::atomic_uintptr_t>::value), "");
|
||||
|
||||
static_assert((std::is_same<std::atomic<int8_t>, std::atomic_int8_t>::value), "");
|
||||
static_assert((std::is_same<std::atomic<uint8_t>, std::atomic_uint8_t>::value), "");
|
||||
|
@ -200,8 +200,8 @@ void f() {
|
||||
static_assert(std::is_same_v<std::atomic<int_fast64_t>, ::atomic_int_fast64_t>);
|
||||
static_assert(std::is_same_v<std::atomic<uint_fast64_t>, ::atomic_uint_fast64_t>);
|
||||
|
||||
static_assert(std::is_same_v<std::atomic<intptr_t>, ::atomic_intptr_t>);
|
||||
static_assert(std::is_same_v<std::atomic<uintptr_t>, ::atomic_uintptr_t>);
|
||||
static_assert(std::is_same_v<std::atomic<std::intptr_t>, ::atomic_intptr_t>);
|
||||
static_assert(std::is_same_v<std::atomic<std::uintptr_t>, ::atomic_uintptr_t>);
|
||||
static_assert(std::is_same_v<std::atomic<std::size_t>, ::atomic_size_t>);
|
||||
static_assert(std::is_same_v<std::atomic<std::ptrdiff_t>, ::atomic_ptrdiff_t>);
|
||||
static_assert(std::is_same_v<std::atomic<intmax_t>, ::atomic_intmax_t>);
|
||||
|
@ -146,8 +146,8 @@ int main(int, char**)
|
||||
test< std::int64_t> ();
|
||||
test<std::uint64_t> ();
|
||||
|
||||
test<intptr_t> ();
|
||||
test<uintptr_t> ();
|
||||
test<std::intptr_t> ();
|
||||
test<std::uintptr_t> ();
|
||||
test<std::size_t> ();
|
||||
test<std::ptrdiff_t> ();
|
||||
test<intmax_t> ();
|
||||
|
@ -47,7 +47,7 @@ struct identity {
|
||||
void compile_generator() {
|
||||
supported_simd128_ctor<int>(identity());
|
||||
not_supported_simd128_ctor<int>([](int i) { return float(i); });
|
||||
not_supported_simd128_ctor<int>([](intptr_t i) { return (int*)(i); });
|
||||
not_supported_simd128_ctor<int>([](std::intptr_t i) { return (int*)(i); });
|
||||
not_supported_simd128_ctor<int>([](int* i) { return i; });
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ int main(int, char**)
|
||||
static_assert(toobig<std::uint64_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
|
||||
static_assert(toobig<std::size_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
|
||||
static_assert(toobig<uintmax_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
|
||||
static_assert(toobig<uintptr_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
|
||||
static_assert(toobig<std::uintptr_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ int main(int, char**)
|
||||
static_assert(!std::is_invocable_v<L, std::int32_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::int64_t>);
|
||||
static_assert(!std::is_invocable_v<L, intmax_t>);
|
||||
static_assert(!std::is_invocable_v<L, intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
|
||||
|
||||
static_assert(!std::is_invocable_v<L, bool>);
|
||||
@ -120,7 +120,7 @@ int main(int, char**)
|
||||
static_assert(test<std::uint32_t>());
|
||||
static_assert(test<std::uint64_t>());
|
||||
static_assert(test<uintmax_t>());
|
||||
static_assert(test<uintptr_t>());
|
||||
static_assert(test<std::uintptr_t>());
|
||||
static_assert(test<std::size_t>());
|
||||
|
||||
test<unsigned char>();
|
||||
@ -136,7 +136,7 @@ int main(int, char**)
|
||||
test<std::uint32_t>();
|
||||
test<std::uint64_t>();
|
||||
test<uintmax_t>();
|
||||
test<uintptr_t>();
|
||||
test<std::uintptr_t>();
|
||||
test<std::size_t>();
|
||||
|
||||
return 0;
|
||||
|
@ -86,7 +86,7 @@ int main(int, char**)
|
||||
static_assert(!std::is_invocable_v<L, std::int32_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::int64_t>);
|
||||
static_assert(!std::is_invocable_v<L, intmax_t>);
|
||||
static_assert(!std::is_invocable_v<L, intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
|
||||
|
||||
static_assert(!std::is_invocable_v<L, bool>);
|
||||
@ -118,7 +118,7 @@ int main(int, char**)
|
||||
static_assert(test<std::uint32_t>());
|
||||
static_assert(test<std::uint64_t>());
|
||||
static_assert(test<uintmax_t>());
|
||||
static_assert(test<uintptr_t>());
|
||||
static_assert(test<std::uintptr_t>());
|
||||
static_assert(test<std::size_t>());
|
||||
|
||||
test<unsigned char>();
|
||||
@ -135,7 +135,7 @@ int main(int, char**)
|
||||
test<std::uint32_t>();
|
||||
test<std::uint64_t>();
|
||||
test<uintmax_t>();
|
||||
test<uintptr_t>();
|
||||
test<std::uintptr_t>();
|
||||
test<std::size_t>();
|
||||
|
||||
return 0;
|
||||
|
@ -91,7 +91,7 @@ int main(int, char**)
|
||||
static_assert(!std::is_invocable_v<L, std::int32_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::int64_t>);
|
||||
static_assert(!std::is_invocable_v<L, intmax_t>);
|
||||
static_assert(!std::is_invocable_v<L, intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
|
||||
|
||||
static_assert(!std::is_invocable_v<L, bool>);
|
||||
@ -122,7 +122,7 @@ int main(int, char**)
|
||||
static_assert(test<std::uint32_t>());
|
||||
static_assert(test<std::uint64_t>());
|
||||
static_assert(test<uintmax_t>());
|
||||
static_assert(test<uintptr_t>());
|
||||
static_assert(test<std::uintptr_t>());
|
||||
static_assert(test<std::size_t>());
|
||||
|
||||
test<unsigned char>();
|
||||
@ -138,7 +138,7 @@ int main(int, char**)
|
||||
test<std::uint32_t>();
|
||||
test<std::uint64_t>();
|
||||
test<uintmax_t>();
|
||||
test<uintptr_t>();
|
||||
test<std::uintptr_t>();
|
||||
test<std::size_t>();
|
||||
|
||||
return 0;
|
||||
|
@ -89,7 +89,7 @@ int main(int, char**)
|
||||
static_assert(!std::is_invocable_v<L, std::int32_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::int64_t>);
|
||||
static_assert(!std::is_invocable_v<L, intmax_t>);
|
||||
static_assert(!std::is_invocable_v<L, intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
|
||||
|
||||
static_assert(!std::is_invocable_v<L, bool>);
|
||||
@ -120,7 +120,7 @@ int main(int, char**)
|
||||
static_assert(test<std::uint32_t>());
|
||||
static_assert(test<std::uint64_t>());
|
||||
static_assert(test<uintmax_t>());
|
||||
static_assert(test<uintptr_t>());
|
||||
static_assert(test<std::uintptr_t>());
|
||||
static_assert(test<std::size_t>());
|
||||
|
||||
test<unsigned char>();
|
||||
@ -136,7 +136,7 @@ int main(int, char**)
|
||||
test<std::uint32_t>();
|
||||
test<std::uint64_t>();
|
||||
test<uintmax_t>();
|
||||
test<uintptr_t>();
|
||||
test<std::uintptr_t>();
|
||||
test<std::size_t>();
|
||||
|
||||
return 0;
|
||||
|
@ -86,7 +86,7 @@ int main(int, char**)
|
||||
static_assert(!std::is_invocable_v<L, std::int32_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::int64_t>);
|
||||
static_assert(!std::is_invocable_v<L, intmax_t>);
|
||||
static_assert(!std::is_invocable_v<L, intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
|
||||
|
||||
static_assert(!std::is_invocable_v<L, bool>);
|
||||
@ -117,7 +117,7 @@ int main(int, char**)
|
||||
static_assert(test<std::uint32_t>());
|
||||
static_assert(test<std::uint64_t>());
|
||||
static_assert(test<uintmax_t>());
|
||||
static_assert(test<uintptr_t>());
|
||||
static_assert(test<std::uintptr_t>());
|
||||
static_assert(test<std::size_t>());
|
||||
|
||||
test<unsigned char>();
|
||||
@ -133,7 +133,7 @@ int main(int, char**)
|
||||
test<std::uint32_t>();
|
||||
test<std::uint64_t>();
|
||||
test<uintmax_t>();
|
||||
test<uintptr_t>();
|
||||
test<std::uintptr_t>();
|
||||
test<std::size_t>();
|
||||
|
||||
return 0;
|
||||
|
@ -85,7 +85,7 @@ int main(int, char**)
|
||||
static_assert(!std::is_invocable_v<L, std::int32_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::int64_t>);
|
||||
static_assert(!std::is_invocable_v<L, intmax_t>);
|
||||
static_assert(!std::is_invocable_v<L, intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
|
||||
|
||||
static_assert(!std::is_invocable_v<L, bool>);
|
||||
@ -116,7 +116,7 @@ int main(int, char**)
|
||||
static_assert(test<std::uint32_t>());
|
||||
static_assert(test<std::uint64_t>());
|
||||
static_assert(test<uintmax_t>());
|
||||
static_assert(test<uintptr_t>());
|
||||
static_assert(test<std::uintptr_t>());
|
||||
static_assert(test<std::size_t>());
|
||||
|
||||
test<unsigned char>();
|
||||
@ -132,7 +132,7 @@ int main(int, char**)
|
||||
test<std::uint32_t>();
|
||||
test<std::uint64_t>();
|
||||
test<uintmax_t>();
|
||||
test<uintptr_t>();
|
||||
test<std::uintptr_t>();
|
||||
test<std::size_t>();
|
||||
|
||||
return 0;
|
||||
|
@ -90,7 +90,7 @@ int main(int, char**)
|
||||
static_assert(!std::is_invocable_v<L, std::int32_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::int64_t>);
|
||||
static_assert(!std::is_invocable_v<L, intmax_t>);
|
||||
static_assert(!std::is_invocable_v<L, intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
|
||||
|
||||
static_assert(!std::is_invocable_v<L, bool>);
|
||||
@ -121,7 +121,7 @@ int main(int, char**)
|
||||
static_assert(test<std::uint32_t>());
|
||||
static_assert(test<std::uint64_t>());
|
||||
static_assert(test<uintmax_t>());
|
||||
static_assert(test<uintptr_t>());
|
||||
static_assert(test<std::uintptr_t>());
|
||||
static_assert(test<std::size_t>());
|
||||
|
||||
test<unsigned char>();
|
||||
@ -137,7 +137,7 @@ int main(int, char**)
|
||||
test<std::uint32_t>();
|
||||
test<std::uint64_t>();
|
||||
test<uintmax_t>();
|
||||
test<uintptr_t>();
|
||||
test<std::uintptr_t>();
|
||||
test<std::size_t>();
|
||||
|
||||
return 0;
|
||||
|
@ -87,7 +87,7 @@ int main(int, char**)
|
||||
static_assert(!std::is_invocable_v<L, std::int32_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::int64_t>);
|
||||
static_assert(!std::is_invocable_v<L, intmax_t>);
|
||||
static_assert(!std::is_invocable_v<L, intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
|
||||
|
||||
static_assert(!std::is_invocable_v<L, bool>);
|
||||
@ -118,7 +118,7 @@ int main(int, char**)
|
||||
static_assert(test<std::uint32_t>());
|
||||
static_assert(test<std::uint64_t>());
|
||||
static_assert(test<uintmax_t>());
|
||||
static_assert(test<uintptr_t>());
|
||||
static_assert(test<std::uintptr_t>());
|
||||
static_assert(test<std::size_t>());
|
||||
|
||||
test<unsigned char>();
|
||||
@ -134,7 +134,7 @@ int main(int, char**)
|
||||
test<std::uint32_t>();
|
||||
test<std::uint64_t>();
|
||||
test<uintmax_t>();
|
||||
test<uintptr_t>();
|
||||
test<std::uintptr_t>();
|
||||
test<std::size_t>();
|
||||
|
||||
return 0;
|
||||
|
@ -97,7 +97,7 @@ int main(int, char**)
|
||||
static_assert(!std::is_invocable_v<L, std::int32_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::int64_t>);
|
||||
static_assert(!std::is_invocable_v<L, intmax_t>);
|
||||
static_assert(!std::is_invocable_v<L, intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
|
||||
|
||||
static_assert(!std::is_invocable_v<L, bool>);
|
||||
@ -128,7 +128,7 @@ int main(int, char**)
|
||||
static_assert(test<std::uint32_t>());
|
||||
static_assert(test<std::uint64_t>());
|
||||
static_assert(test<uintmax_t>());
|
||||
static_assert(test<uintptr_t>());
|
||||
static_assert(test<std::uintptr_t>());
|
||||
static_assert(test<std::size_t>());
|
||||
|
||||
test<unsigned char>();
|
||||
@ -144,7 +144,7 @@ int main(int, char**)
|
||||
test<std::uint32_t>();
|
||||
test<std::uint64_t>();
|
||||
test<uintmax_t>();
|
||||
test<uintptr_t>();
|
||||
test<std::uintptr_t>();
|
||||
test<std::size_t>();
|
||||
|
||||
return 0;
|
||||
|
@ -85,7 +85,7 @@ int main(int, char**)
|
||||
static_assert(!std::is_invocable_v<L, std::int32_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::int64_t>);
|
||||
static_assert(!std::is_invocable_v<L, intmax_t>);
|
||||
static_assert(!std::is_invocable_v<L, intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
|
||||
|
||||
static_assert(!std::is_invocable_v<L, bool>);
|
||||
@ -117,7 +117,7 @@ int main(int, char**)
|
||||
static_assert(test<std::uint32_t>());
|
||||
static_assert(test<std::uint64_t>());
|
||||
static_assert(test<uintmax_t>());
|
||||
static_assert(test<uintptr_t>());
|
||||
static_assert(test<std::uintptr_t>());
|
||||
static_assert(test<std::size_t>());
|
||||
|
||||
test<unsigned char>();
|
||||
@ -134,7 +134,7 @@ int main(int, char**)
|
||||
test<std::uint32_t>();
|
||||
test<std::uint64_t>();
|
||||
test<uintmax_t>();
|
||||
test<uintptr_t>();
|
||||
test<std::uintptr_t>();
|
||||
test<std::size_t>();
|
||||
|
||||
return 0;
|
||||
|
@ -86,7 +86,7 @@ int main(int, char**)
|
||||
static_assert(!std::is_invocable_v<L, std::int32_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::int64_t>);
|
||||
static_assert(!std::is_invocable_v<L, intmax_t>);
|
||||
static_assert(!std::is_invocable_v<L, intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::intptr_t>);
|
||||
static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
|
||||
|
||||
static_assert(!std::is_invocable_v<L, bool>);
|
||||
@ -118,7 +118,7 @@ int main(int, char**)
|
||||
static_assert(test<std::uint32_t>());
|
||||
static_assert(test<std::uint64_t>());
|
||||
static_assert(test<uintmax_t>());
|
||||
static_assert(test<uintptr_t>());
|
||||
static_assert(test<std::uintptr_t>());
|
||||
static_assert(test<std::size_t>());
|
||||
|
||||
test<unsigned char>();
|
||||
@ -135,7 +135,7 @@ int main(int, char**)
|
||||
test<std::uint32_t>();
|
||||
test<std::uint64_t>();
|
||||
test<uintmax_t>();
|
||||
test<uintptr_t>();
|
||||
test<std::uintptr_t>();
|
||||
test<std::size_t>();
|
||||
|
||||
return 0;
|
||||
|
@ -21,7 +21,7 @@ template <bool Const>
|
||||
struct ConvertibleIter : IterBase<ConvertibleIter<Const>> {
|
||||
using iterator_category = std::random_access_iterator_tag;
|
||||
using value_type = std::tuple<int>;
|
||||
using difference_type = intptr_t;
|
||||
using difference_type = std::intptr_t;
|
||||
|
||||
bool movedFromOtherConst = false;
|
||||
int i = 0;
|
||||
|
@ -23,7 +23,7 @@ struct Iter {
|
||||
std::tuple<int>* it_;
|
||||
|
||||
using value_type = std::tuple<int>;
|
||||
using difference_type = intptr_t;
|
||||
using difference_type = std::intptr_t;
|
||||
using iterator_concept = std::input_iterator_tag;
|
||||
|
||||
constexpr decltype(auto) operator*() const { return *it_; }
|
||||
|
@ -93,7 +93,7 @@ template <class Derived>
|
||||
struct IterBase {
|
||||
using iterator_concept = std::random_access_iterator_tag;
|
||||
using value_type = std::tuple<int>;
|
||||
using difference_type = intptr_t;
|
||||
using difference_type = std::intptr_t;
|
||||
|
||||
constexpr std::tuple<int> operator*() const { return std::tuple<int>(5); }
|
||||
|
||||
|
@ -20,7 +20,7 @@ template <class Derived>
|
||||
struct ForwardIterBase {
|
||||
using iterator_concept = std::forward_iterator_tag;
|
||||
using value_type = int;
|
||||
using difference_type = intptr_t;
|
||||
using difference_type = std::intptr_t;
|
||||
|
||||
constexpr int operator*() const { return 5; }
|
||||
|
||||
|
@ -26,7 +26,7 @@ struct Iter {
|
||||
int* it_;
|
||||
|
||||
using value_type = int;
|
||||
using difference_type = intptr_t;
|
||||
using difference_type = std::intptr_t;
|
||||
using iterator_concept = std::input_iterator_tag;
|
||||
|
||||
constexpr decltype(auto) operator*() const { return *it_; }
|
||||
|
@ -63,7 +63,7 @@ constexpr bool test() {
|
||||
assert(&y1 == &(b[3]));
|
||||
|
||||
using Iter = decltype(it1);
|
||||
static_assert(canPlusEqual<Iter, intptr_t>);
|
||||
static_assert(canPlusEqual<Iter, std::intptr_t>);
|
||||
}
|
||||
|
||||
{
|
||||
@ -83,7 +83,7 @@ constexpr bool test() {
|
||||
assert(&y1 == &(b[2]));
|
||||
|
||||
using Iter = decltype(it1);
|
||||
static_assert(canMinusEqual<Iter, intptr_t>);
|
||||
static_assert(canMinusEqual<Iter, std::intptr_t>);
|
||||
}
|
||||
|
||||
{
|
||||
@ -116,12 +116,12 @@ constexpr bool test() {
|
||||
// One of the ranges is not random access
|
||||
std::ranges::zip_view v(a, b, ForwardSizedView{buffer1});
|
||||
using Iter = decltype(v.begin());
|
||||
static_assert(!std::invocable<std::plus<>, Iter, intptr_t>);
|
||||
static_assert(!std::invocable<std::plus<>, intptr_t, Iter>);
|
||||
static_assert(!canPlusEqual<Iter, intptr_t>);
|
||||
static_assert(!std::invocable<std::minus<>, Iter, intptr_t>);
|
||||
static_assert(!std::invocable<std::plus<>, Iter, std::intptr_t>);
|
||||
static_assert(!std::invocable<std::plus<>, std::intptr_t, Iter>);
|
||||
static_assert(!canPlusEqual<Iter, std::intptr_t>);
|
||||
static_assert(!std::invocable<std::minus<>, Iter, std::intptr_t>);
|
||||
static_assert(std::invocable<std::minus<>, Iter, Iter>);
|
||||
static_assert(!canMinusEqual<Iter, intptr_t>);
|
||||
static_assert(!canMinusEqual<Iter, std::intptr_t>);
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -41,7 +41,7 @@ struct LessThanIterator {
|
||||
|
||||
using iterator_category = std::random_access_iterator_tag;
|
||||
using value_type = int;
|
||||
using difference_type = intptr_t;
|
||||
using difference_type = std::intptr_t;
|
||||
|
||||
constexpr int& operator*() const { return *it_; }
|
||||
constexpr int& operator[](difference_type n) const { return it_[n]; }
|
||||
|
@ -20,7 +20,7 @@ struct PODIter {
|
||||
|
||||
using iterator_category = std::random_access_iterator_tag;
|
||||
using value_type = int;
|
||||
using difference_type = intptr_t;
|
||||
using difference_type = std::intptr_t;
|
||||
|
||||
constexpr int operator*() const { return i; }
|
||||
|
||||
|
@ -144,16 +144,16 @@ void test() {
|
||||
|
||||
{
|
||||
// difference_type of single view
|
||||
std::ranges::zip_view v{DiffTypeRange<intptr_t>{}};
|
||||
std::ranges::zip_view v{DiffTypeRange<std::intptr_t>{}};
|
||||
using Iter = decltype(v.begin());
|
||||
static_assert(std::is_same_v<Iter::difference_type, intptr_t>);
|
||||
static_assert(std::is_same_v<Iter::difference_type, std::intptr_t>);
|
||||
}
|
||||
|
||||
{
|
||||
// difference_type of multiple views should be the common type
|
||||
std::ranges::zip_view v{DiffTypeRange<intptr_t>{}, DiffTypeRange<std::ptrdiff_t>{}};
|
||||
std::ranges::zip_view v{DiffTypeRange<std::intptr_t>{}, DiffTypeRange<std::ptrdiff_t>{}};
|
||||
using Iter = decltype(v.begin());
|
||||
static_assert(std::is_same_v<Iter::difference_type, std::common_type_t<intptr_t, std::ptrdiff_t>>);
|
||||
static_assert(std::is_same_v<Iter::difference_type, std::common_type_t<std::intptr_t, std::ptrdiff_t>>);
|
||||
}
|
||||
|
||||
const std::array foos{Foo{}};
|
||||
|
@ -34,7 +34,7 @@ struct convertible_forward_sized_iterator {
|
||||
|
||||
using iterator_category = std::forward_iterator_tag;
|
||||
using value_type = int;
|
||||
using difference_type = intptr_t;
|
||||
using difference_type = std::intptr_t;
|
||||
|
||||
convertible_forward_sized_iterator() = default;
|
||||
constexpr convertible_forward_sized_iterator(Base it) : it_(it) {}
|
||||
|
@ -201,7 +201,7 @@ struct forward_sized_iterator {
|
||||
|
||||
using iterator_category = std::forward_iterator_tag;
|
||||
using value_type = int;
|
||||
using difference_type = intptr_t;
|
||||
using difference_type = std::intptr_t;
|
||||
using pointer = Base;
|
||||
using reference = decltype(*Base{});
|
||||
|
||||
@ -405,7 +405,7 @@ struct iter_move_swap_iterator {
|
||||
|
||||
using iterator_category = std::input_iterator_tag;
|
||||
using value_type = int;
|
||||
using difference_type = intptr_t;
|
||||
using difference_type = std::intptr_t;
|
||||
|
||||
constexpr int operator*() const { return i; }
|
||||
|
||||
|
@ -59,7 +59,7 @@ void test(StringT expected, StringViewT fmt, PointerT arg) {
|
||||
buffer[0] = CharT('0');
|
||||
buffer[1] = CharT('x');
|
||||
expected.append(buffer.begin(),
|
||||
std::to_chars(buffer.begin() + 2, buffer.end(), reinterpret_cast<uintptr_t>(arg), 16).ptr);
|
||||
std::to_chars(buffer.begin() + 2, buffer.end(), reinterpret_cast<std::uintptr_t>(arg), 16).ptr);
|
||||
}
|
||||
assert(result == expected);
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ int main(int, char**)
|
||||
test<std::int_least64_t>();
|
||||
|
||||
test<intmax_t>();
|
||||
test<intptr_t>();
|
||||
test<std::intptr_t>();
|
||||
|
||||
test<std::uint8_t>();
|
||||
test<std::uint16_t>();
|
||||
@ -108,7 +108,7 @@ int main(int, char**)
|
||||
test<std::uint_least64_t>();
|
||||
|
||||
test<uintmax_t>();
|
||||
test<uintptr_t>();
|
||||
test<std::uintptr_t>();
|
||||
|
||||
#ifndef TEST_HAS_NO_INT128
|
||||
test<__int128_t>();
|
||||
|
@ -40,7 +40,7 @@ int main(int, char**)
|
||||
{
|
||||
std::pair<A*, std::ptrdiff_t> ip = std::get_temporary_buffer<A>(5);
|
||||
assert(!(ip.first == nullptr) ^ (ip.second == 0));
|
||||
assert(reinterpret_cast<uintptr_t>(ip.first) % alignof(A) == 0);
|
||||
assert(reinterpret_cast<std::uintptr_t>(ip.first) % alignof(A) == 0);
|
||||
std::return_temporary_buffer(ip.first);
|
||||
|
||||
return 0;
|
||||
|
@ -123,7 +123,7 @@ struct Bar {
|
||||
};
|
||||
|
||||
void test_aligned(void* p, std::size_t align) {
|
||||
assert(reinterpret_cast<uintptr_t>(p) % align == 0);
|
||||
assert(reinterpret_cast<std::uintptr_t>(p) % align == 0);
|
||||
}
|
||||
|
||||
int main(int, char**) {
|
||||
|
@ -43,8 +43,8 @@ int main(int, char**)
|
||||
{
|
||||
test_alignment_of<int&, 4>();
|
||||
test_alignment_of<Class, 1>();
|
||||
test_alignment_of<int*, sizeof(intptr_t)>();
|
||||
test_alignment_of<const int*, sizeof(intptr_t)>();
|
||||
test_alignment_of<int*, sizeof(std::intptr_t)>();
|
||||
test_alignment_of<const int*, sizeof(std::intptr_t)>();
|
||||
test_alignment_of<char[3], 1>();
|
||||
test_alignment_of<int, 4>();
|
||||
test_alignment_of<double, TEST_ALIGNOF(double)>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user