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

Fix MSVC test failures. #269

Merged
merged 12 commits into from
Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .upstream-tests/test/heterogeneous/tuple.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
//===----------------------------------------------------------------------===//

// UNSUPPORTED: nvrtc
// Internal compiler error in 14.24
// XFAIL: msvc-19.20, msvc-19.21, msvc-19.22, msvc-19.23, msvc-19.24, msvc-19.25

// uncomment for a really verbose output detailing what test steps are being launched
// #define DEBUG_TESTERS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
// template<Integral T> complex<double> conj(T);
// complex<float> conj(float);

#if defined(_MSC_VER)
#pragma warning(disable: 4244) // conversion from 'const double' to 'int', possible loss of data
#endif

#include <cuda/std/complex>
#include <cuda/std/type_traits>
#include <cuda/std/cassert>

#include "test_macros.h"
#include "../cases.h"

#if defined(_MSC_VER)
#pragma warning(disable: 4244) // conversion from 'const double' to 'int', possible loss of data
#endif

template <class T>
__host__ __device__ void
test(T x, typename cuda::std::enable_if<cuda::std::is_integral<T>::value>::type* = 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
// complex<promote<T, U>::type>
// pow(const complex<T>& x, const complex<U>& y);

#if defined(_MSC_VER)
#pragma warning(disable: 4244) // conversion from 'const double' to 'int', possible loss of data
#endif

#include <cuda/std/complex>
#include <cuda/std/type_traits>
#include <cuda/std/cassert>

#include "test_macros.h"
#include "../cases.h"

#if defined(_MSC_VER)
#pragma warning(disable: 4244) // conversion from 'const double' to 'int', possible loss of data
#endif

template <class T>
__host__ __device__ double
promote(T, typename cuda::std::enable_if<cuda::std::is_integral<T>::value>::type* = 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
// template<Integral T> complex<double> proj(T);
// complex<float> proj(float);

#if defined(_MSC_VER)
#pragma warning(disable: 4244) // conversion from 'const double' to 'int', possible loss of data
#endif

#include <cuda/std/complex>
#include <cuda/std/type_traits>
#include <cuda/std/cassert>

#include "test_macros.h"
#include "../cases.h"

#if defined(_MSC_VER)
#pragma warning(disable: 4244) // conversion from 'const double' to 'int', possible loss of data
#endif

template <class T>
__host__ __device__ void
test(T x, typename cuda::std::enable_if<cuda::std::is_integral<T>::value>::type* = 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
// T
// real(const T& x);

#if defined(_MSC_VER)
#pragma warning(disable: 4244) // conversion from 'const double' to 'int', possible loss of data
#endif

#include <cuda/std/complex>
#include <cuda/std/type_traits>
#include <cuda/std/cassert>

#include "test_macros.h"
#include "../cases.h"

#if defined(_MSC_VER)
#pragma warning(disable: 4244) // conversion from 'const double' to 'int', possible loss of data
#endif

template <class T, int x>
__host__ __device__ void
test(typename cuda::std::enable_if<cuda::std::is_integral<T>::value>::type* = 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
// complex& operator=(const complex&);
// template<class X> complex& operator= (const complex<X>&);

#if defined(_MSC_VER)
#pragma warning(disable: 4244) // conversion from 'const double' to 'int', possible loss of data
#endif

#include <cuda/std/complex>
#include <cuda/std/cassert>

#include "test_macros.h"

#if defined(_MSC_VER)
#pragma warning(disable: 4244) // conversion from 'const double' to 'int', possible loss of data
#endif

template <class T, class X>
__host__ __device__ void
test()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@

// complex& operator/=(const complex& rhs);

#if defined(_MSC_VER)
# pragma warning(disable: 4244) // conversion from 'const double' to 'int', possible loss of data
#endif

#include <cuda/std/complex>
#include <cuda/std/cassert>

#include "test_macros.h"

#if defined(_MSC_VER)
#pragma warning(disable: 4244) // conversion from 'const double' to 'int', possible loss of data
#endif

template <class T>
__host__ __device__ void
test()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@

// complex& operator*=(const complex& rhs);

#if defined(_MSC_VER)
#pragma warning(disable: 4244) // conversion from 'const double' to 'int', possible loss of data
#endif

#include <cuda/std/complex>
#include <cuda/std/cassert>

#include "test_macros.h"

#if defined(_MSC_VER)
#pragma warning(disable: 4244) // conversion from 'const double' to 'int', possible loss of data
#endif

template <class T>
__host__ __device__ void
test()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@

#include "test_macros.h"

// MSVC warns about unsigned/signed comparisons and addition/subtraction
// Silence these warnings, but not the ones within the header itself.
#if defined(_MSC_VER)
# pragma warning( disable: 4307 )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add comments to these, similarly how the 4244 disables have comments?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comments.

# pragma warning( disable: 4308 )
#endif

template <typename D, typename Ds>
__host__ __device__
constexpr bool testConstexpr()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@

#include "test_macros.h"

// MSVC warns about unsigned/signed comparisons and addition/subtraction
// Silence these warnings, but not the ones within the header itself.
#if defined(_MSC_VER)
# pragma warning( disable: 4307 )
# pragma warning( disable: 4308 )
#endif

template <typename D, typename Ds>
__host__ __device__
constexpr bool testConstexpr()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@

#include "test_macros.h"

// MSVC warns about unsigned/signed comparisons and addition/subtraction
// Silence these warnings, but not the ones within the header itself.
#if defined(_MSC_VER)
# pragma warning( disable: 4307 )
# pragma warning( disable: 4308 )
#endif

template <typename M, typename Ms>
__host__ __device__
constexpr bool testConstexpr()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@

#include "test_macros.h"

// MSVC warns about unsigned/signed comparisons and addition/subtraction
// Silence these warnings, but not the ones within the header itself.
#if defined(_MSC_VER)
# pragma warning( disable: 4307 )
# pragma warning( disable: 4308 )
#endif

int main(int, char**)
{
using year = cuda::std::chrono::year;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// constexpr year_month_day(const sys_days& dp) noexcept;
//
// Effects: Constructs an object of type year_month_day that corresponds
// Effects: Constructs an object of type year_month_day that corresponds
// to the date represented by dp.
//
// Remarks: For any value ymd of type year_month_day for which ymd.ok() is true,
Expand All @@ -28,6 +28,13 @@

#include "test_macros.h"

// MSVC warns about unsigned/signed comparisons and addition/subtraction
// Silence these warnings, but not the ones within the header itself.
#if defined(_MSC_VER)
# pragma warning( disable: 4307 )
# pragma warning( disable: 4308 )
#endif

int main(int, char**)
{
using year = cuda::std::chrono::year;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,21 @@

#include "test_macros.h"

// MSVC warns about unsigned/signed comparisons and addition/subtraction
// Silence these warnings, but not the ones within the header itself.
#if defined(_MSC_VER)
# pragma warning( disable: 4307 )
# pragma warning( disable: 4308 )
#endif

__host__ __device__
void RunTheExample()
{
using namespace cuda::std::chrono;

static_assert(year_month_day{local_days{year{2017}/January/0}} == year{2016}/December/31,"");
static_assert(year_month_day{local_days{year{2017}/January/31}} == year{2017}/January/31,"");
static_assert(year_month_day{local_days{year{2017}/January/32}} == year{2017}/February/1,"");
static_assert(year_month_day{local_days{year{2017}/January/32}} == year{2017}/February/1,"");
}

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

#include "test_macros.h"

// MSVC warns about unsigned/signed comparisons and addition/subtraction
// Silence these warnings, but not the ones within the header itself.
#if defined(_MSC_VER)
# pragma warning( disable: 4307 )
# pragma warning( disable: 4308 )
#endif

__host__ __device__
void RunTheExample()
{
using namespace cuda::std::chrono;

static_assert(year_month_day{sys_days{year{2017}/January/0}} == year{2016}/December/31,"");
static_assert(year_month_day{sys_days{year{2017}/January/31}} == year{2017}/January/31,"");
static_assert(year_month_day{sys_days{year{2017}/January/32}} == year{2017}/February/1,"");
static_assert(year_month_day{sys_days{year{2017}/January/32}} == year{2017}/February/1,"");
}

int main(int, char**)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@

#include "test_macros.h"

// MSVC warns about unsigned/signed comparisons and addition/subtraction
// Silence these warnings, but not the ones within the header itself.
#if defined(_MSC_VER)
# pragma warning( disable: 4307 )
# pragma warning( disable: 4308 )
#endif

int main(int, char**)
{
using year = cuda::std::chrono::year;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@

#include "test_macros.h"

// MSVC warns about unsigned/signed comparisons and addition/subtraction
// Silence these warnings, but not the ones within the header itself.
#if defined(_MSC_VER)
# pragma warning( disable: 4307 )
# pragma warning( disable: 4308 )
#endif

int main(int, char**)
{
using year = cuda::std::chrono::year;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@

#include "test_macros.h"

// MSVC warns about unsigned/signed comparisons and addition/subtraction
// Silence these warnings, but not the ones within the header itself.
#if defined(_MSC_VER)
# pragma warning( disable: 4307 )
# pragma warning( disable: 4308 )
#endif

int main(int, char**)
{
using year = cuda::std::chrono::year;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@

#include "test_macros.h"

// MSVC warns about unsigned/signed comparisons and addition/subtraction
// Silence these warnings, but not the ones within the header itself.
#if defined(_MSC_VER)
# pragma warning( disable: 4307 )
# pragma warning( disable: 4308 )
#endif

int main(int, char**)
{
using year = cuda::std::chrono::year;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

// constexpr unspecified ignore;

// UNSUPPORTED: c++98, c++03
// UNSUPPORTED: c++98, c++03
// Internal compiler error in 14.24
// XFAIL: msvc-19.20, msvc-19.21, msvc-19.22, msvc-19.23, msvc-19.24, msvc-19.25

#include <cuda/std/tuple>
#include <cuda/std/cassert>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
//===----------------------------------------------------------------------===//
//

// UNSUPPORTED: c++98, c++03
// UNSUPPORTED: c++98, c++03
// Internal compiler error in 14.24
// XFAIL: msvc-19.20, msvc-19.21, msvc-19.22, msvc-19.23, msvc-19.24, msvc-19.25

// Tuples of smart pointers; based on bug #18350
// auto_ptr doesn't have a copy constructor that takes a const &, but tuple does.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
//
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++98, c++03
// UNSUPPORTED: c++98, c++03
// Internal compiler error in 14.24
// XFAIL: msvc-19.20, msvc-19.21, msvc-19.22, msvc-19.23, msvc-19.24, msvc-19.25

// This is for bugs 18853 and 19118

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

// UNSUPPORTED: c++98, c++03, c++11, c++14
// UNSUPPORTED: c++98, c++03, c++11, c++14
// UNSUPPORTED: nvrtc

// Internal compiler error in 14.24
// XFAIL: msvc-19.20, msvc-19.21, msvc-19.22, msvc-19.23, msvc-19.24, msvc-19.25
// <cuda/std/tuple>

// template <class F, class T> constexpr decltype(auto) apply(F &&, T &&)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@



// UNSUPPORTED: c++98, c++03, c++11, c++14
// UNSUPPORTED: c++98, c++03, c++11, c++14
// Internal compiler error in 14.24
// XFAIL: msvc-19.20, msvc-19.21, msvc-19.22, msvc-19.23, msvc-19.24, msvc-19.25

// <cuda/std/tuple>

Expand Down
Loading