Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Fix gcc12 issues #318

Merged
merged 10 commits into from
Sep 30, 2022
12 changes: 6 additions & 6 deletions .upstream-tests/test/heterogeneous/pair.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct pod {
using pair_t = cuda::std::pair<int, pod>;

template<int N>
struct write
struct Write
{
using async = cuda::std::false_type;

Expand All @@ -37,7 +37,7 @@ struct write
};

template<int N>
struct read
struct Read
{
using async = cuda::std::false_type;

Expand All @@ -51,10 +51,10 @@ struct read
};

using w_r_w_r = performer_list<
write<10>,
read<10>,
write<30>,
read<30>
Write<10>,
Read<10>,
Write<30>,
Read<30>
>;

void kernel_invoker()
Expand Down
12 changes: 6 additions & 6 deletions .upstream-tests/test/heterogeneous/tuple.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct pod {
using tuple_t = cuda::std::tuple<int, pod, unsigned long long>;

template<int N>
struct write
struct Write
{
using async = cuda::std::false_type;

Expand All @@ -40,7 +40,7 @@ struct write
};

template<int N>
struct read
struct Read
{
using async = cuda::std::false_type;

Expand All @@ -55,10 +55,10 @@ struct read
};

using w_r_w_r = performer_list<
write<10>,
read<10>,
write<30>,
read<30>
Write<10>,
Read<10>,
Write<30>,
Read<30>
>;

void kernel_invoker()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
//
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads, c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-has-no-threads, pre-sm-60
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17

#include <cuda/std/atomic>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#include <cuda/std/string_view>
#endif

#if defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wtype-limits"
#endif

#include "test_macros.h"

struct short_container {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// type_traits

// is_convertible
#pragma nv_diag_suppress 3013 // a volatile function parameter is deprecated

#include <cuda/std/type_traits>
#include "test_macros.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
//
// result_of<Fn(ArgTypes...)>

#pragma nv_diag_suppress 3013 // a volatile function parameter is deprecated

#include <cuda/std/type_traits>
// #include <cuda/std/memory>
// #include <cuda/std/utility>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,21 @@ int main(int, char**)

test_is_constructible<Base, Derived>();
test_is_constructible<Base&, Derived&>();
#if !defined(TEST_COMPILER_GCC) || TEST_STD_VER < 20
test_is_not_constructible<Derived&, Base&>();
#endif
test_is_constructible<Base const&, Derived const&>();
#if !defined(TEST_COMPILER_GCC) || TEST_STD_VER < 20
test_is_not_constructible<Derived const&, Base const&>();
test_is_not_constructible<Derived const&, Base>();
#endif

test_is_constructible<Base&&, Derived>();
test_is_constructible<Base&&, Derived&&>();
#if !defined(TEST_COMPILER_GCC) || TEST_STD_VER < 20
test_is_not_constructible<Derived&&, Base&&>();
test_is_not_constructible<Derived&&, Base>();
#endif

// test that T must also be destructible
test_is_constructible<PrivateDtor&, PrivateDtor&>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ int main(int, char**)
test_is_copy_constructible<NotEmpty>();
test_is_copy_constructible<bit_zero>();

#if !defined(TEST_COMPILER_GCC) || TEST_STD_VER < 20
test_is_not_copy_constructible<char[3]>();
test_is_not_copy_constructible<char[]>();
#endif
test_is_not_copy_constructible<void>();
test_is_not_copy_constructible<Abstract>();
test_is_not_copy_constructible<C>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ struct B

int main(int, char**)
{
#if !defined(TEST_COMPILER_GCC) || TEST_STD_VER < 20
test_is_not_move_constructible<char[3]>();
test_is_not_move_constructible<char[]>();
#endif
test_is_not_move_constructible<void>();
test_is_not_move_constructible<Abstract>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

int main(int, char**)
{
#ifndef _LIBCUDACXX_HAS_NO_CXX20_CHRONO_LITERALS
{
using namespace cuda::std::chrono;
ASSERT_NOEXCEPT( 4d);
Expand All @@ -31,7 +32,7 @@ int main(int, char**)
static_assert( 7d == day(7), "");
day d1 = 4d;
assert (d1 == day(4));
}
}

{
using namespace cuda::std::literals;
Expand All @@ -43,7 +44,7 @@ int main(int, char**)
cuda::std::chrono::day d1 = 4d;
assert (d1 == cuda::std::chrono::day(4));
}

#endif // !_LIBCUDACXX_HAS_NO_CXX20_CHRONO_LITERALS

return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

int main(int, char**)
{
#ifndef _LIBCUDACXX_HAS_NO_CXX20_CHRONO_LITERALS
{
using namespace cuda::std::chrono;
ASSERT_NOEXCEPT(4y);
Expand All @@ -41,6 +42,7 @@ int main(int, char**)
cuda::std::chrono::year y1 = 2020y;
assert (y1 == cuda::std::chrono::year(2020));
}
#endif // !_LIBCUDACXX_HAS_NO_CXX20_CHRONO_LITERALS

return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// XFAIL: dylib-has-no-filesystem

// Due to C++17 inline variables ASAN flags this test as containing an ODR
// violation because Clock::is_steady is defined in both the dylib and this TU.
Expand All @@ -21,6 +22,7 @@
#include <cuda/std/chrono>

template <class T>
__host__ __device__
void test(const T &) {}

int main(int, char**)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "test_macros.h"

template <class Dur>
__host__ __device__
void test() {
ASSERT_SAME_TYPE(cuda::std::chrono::file_time<Dur>, cuda::std::chrono::time_point<cuda::std::chrono::file_clock, Dur>);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// XFAIL: dylib-has-no-filesystem

// <cuda/std/chrono>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

int main(int, char**)
{
#ifndef __cuda_std__
griwes marked this conversation as resolved.
Show resolved Hide resolved
using local_t = cuda::std::chrono::local_t;
using year = cuda::std::chrono::year;

Expand Down Expand Up @@ -61,6 +62,7 @@ int main(int, char**)
ASSERT_SAME_TYPE(decltype(s0.time_since_epoch()), seconds);
assert( s0.time_since_epoch().count() == 0);
assert( s1.time_since_epoch().count() == 946684800L);
#endif // __cuda_std__

return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// GCC's implementation of class template deduction is still immature and runs
// into issues with libc++. However GCC accepts this code when compiling
// against libstdc++.
// XFAIL: gcc
// XFAIL: gcc-4.8, gcc-5, gcc-6, gcc-7, gcc-8, gcc-9, gcc-10, gcc-11

// Currently broken with Clang + NVCC.
// XFAIL: clang-6, clang-7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
//
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads, c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-has-no-threads, pre-sm-60
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17

#include <atomic>

Expand Down
3 changes: 3 additions & 0 deletions libcxx/test/std/iterators/iterator.container/ssize.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

#include "test_macros.h"

#if defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wtype-limits"
#endif

struct short_container {
uint16_t size() const { return 60000; } // not noexcept
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// NOTE: we currently do not support c++20 <compare>
// XFAIL: c++20

// <compare>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// NOTE: we currently do not support c++20 <compare>
// XFAIL: c++20

// <compare>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// NOTE: we currently do not support c++20 <compare>
// XFAIL: c++20

// <compare>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// NOTE: we currently do not support c++20 <compare>
// XFAIL: c++20

// <compare>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// NOTE: we currently do not support c++20 <compare>
// XFAIL: c++20

// <compare>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// NOTE: we currently do not support c++20 <compare>
// XFAIL: c++20

// <compare>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,21 @@ int main(int, char**)

test_is_constructible<Base, Derived>();
test_is_constructible<Base&, Derived&>();
#if !defined(TEST_COMPILER_GCC) || TEST_STD_VER < 20
test_is_not_constructible<Derived&, Base&>();
#endif
test_is_constructible<Base const&, Derived const&>();
#if !defined(TEST_COMPILER_GCC) || TEST_STD_VER < 20
test_is_not_constructible<Derived const&, Base const&>();
test_is_not_constructible<Derived const&, Base>();
#endif

test_is_constructible<Base&&, Derived>();
test_is_constructible<Base&&, Derived&&>();
#if !defined(TEST_COMPILER_GCC) || TEST_STD_VER < 20
test_is_not_constructible<Derived&&, Base&&>();
test_is_not_constructible<Derived&&, Base>();
#endif

// test that T must also be destructible
test_is_constructible<PrivateDtor&, PrivateDtor&>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ int main(int, char**)
test_is_copy_constructible<NotEmpty>();
test_is_copy_constructible<bit_zero>();

#if !defined(TEST_COMPILER_GCC) || TEST_STD_VER < 20
test_is_not_copy_constructible<char[3]>();
test_is_not_copy_constructible<char[]>();
#endif
test_is_not_copy_constructible<void>();
test_is_not_copy_constructible<Abstract>();
test_is_not_copy_constructible<C>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ struct B

int main(int, char**)
{
#if !defined(TEST_COMPILER_GCC) || TEST_STD_VER < 20
test_is_not_move_constructible<char[3]>();
test_is_not_move_constructible<char[]>();
#endif
test_is_not_move_constructible<void>();
test_is_not_move_constructible<Abstract>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// XFAIL: dylib-has-no-filesystem

// Due to C++17 inline variables ASAN flags this test as containing an ODR
// violation because Clock::is_steady is defined in both the dylib and this TU.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// XFAIL: dylib-has-no-filesystem

// <chrono>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// XFAIL: dylib-has-no-filesystem

// <chrono>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// GCC's implementation of class template deduction is still immature and runs
// into issues with libc++. However GCC accepts this code when compiling
// against libstdc++.
// XFAIL: gcc
// XFAIL: gcc-4.8, gcc-5, gcc-6, gcc-7, gcc-8, gcc-9, gcc-10, gcc-11

// <utility>

Expand Down