Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.
Merged
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
44 changes: 30 additions & 14 deletions thrust/detail/config/cpp_dialect.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,27 +97,43 @@
# define THRUST_COMP_DEPR_IMPL1 /* intentionally blank */
#endif

#define THRUST_COMPILER_DEPRECATION(REQ, FIX) \
THRUST_COMP_DEPR_IMPL(Thrust requires at least REQ. Please FIX. Define THRUST_IGNORE_DEPRECATED_CPP_DIALECT to suppress this message.)
#define THRUST_COMPILER_DEPRECATION(REQ) \
THRUST_COMP_DEPR_IMPL(Thrust requires at least REQ. Define THRUST_IGNORE_DEPRECATED_CPP_DIALECT to suppress this message.)

#define THRUST_COMPILER_DEPRECATION_SOFT(REQ, CUR) \
THRUST_COMP_DEPR_IMPL(Thrust requires at least REQ. CUR is deprecated but still supported. CUR support will be removed in a future release. Define THRUST_IGNORE_DEPRECATED_CPP_DIALECT to suppress this message.)

// Minimum required compiler checks:
#ifndef THRUST_IGNORE_DEPRECATED_COMPILER

// Compiler checks:
# if THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_GCC && THRUST_GCC_VERSION < 50000
THRUST_COMPILER_DEPRECATION(GCC 5.0, upgrade your compiler);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do we no longer say "upgrade your compiler"?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The message was getting too long and awkward with the requested additions, and upgrade your compiler is redundant with your compiler is deprecated so I dropped it.

THRUST_COMPILER_DEPRECATION(GCC 5.0);
# elif THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_CLANG && THRUST_CLANG_VERSION < 70000
THRUST_COMPILER_DEPRECATION(Clang 7.0);
# elif THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_MSVC && THRUST_MSVC_VERSION < 1910
// <2017. Hard upgrade message:
THRUST_COMPILER_DEPRECATION(MSVC 2019 (19.20/16.0/14.20));
# elif THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_MSVC && THRUST_MSVC_VERSION < 1920
// >=2017, <2019. Soft deprecation message:
THRUST_COMPILER_DEPRECATION_SOFT(MSVC 2019 (19.20/16.0/14.20), MSVC 2017);
# endif
# if THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_CLANG && THRUST_CLANG_VERSION < 70000
THRUST_COMPILER_DEPRECATION(Clang 7.0, upgrade your compiler);
# endif
# if THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_MSVC && THRUST_MSVC_VERSION < 1920
THRUST_COMPILER_DEPRECATION(MSVC 2019 (19.20/16.0/14.20), upgrade your compiler);

#endif // THRUST_IGNORE_DEPRECATED_COMPILER

#ifndef THRUST_IGNORE_DEPRECATED_DIALECT

// Dialect checks:
# if THRUST_CPP_DIALECT < 2011
// <C++11. Hard upgrade message:
THRUST_COMPILER_DEPRECATION(C++14);
# elif THRUST_CPP_DIALECT == 2011 && !defined(THRUST_IGNORE_DEPRECATED_CPP_11)
// =C++11. Soft upgrade message:
THRUST_COMPILER_DEPRECATION_SOFT(C++14, C++11);
# endif
#endif

#if !defined(THRUST_IGNORE_DEPRECATED_CPP_DIALECT) && THRUST_CPP_DIALECT < 2014 && \
(THRUST_CPP_DIALECT != 2011 || !defined(THRUST_IGNORE_DEPRECATED_CPP_11))
THRUST_COMPILER_DEPRECATION(C++14, pass -std=c++14 to your compiler);
#endif
#endif // THRUST_IGNORE_DEPRECATED_DIALECT

#undef THRUST_COMPILER_DEPRECATION_SOFT
#undef THRUST_COMPILER_DEPRECATION
#undef THRUST_COMP_DEPR_IMPL
#undef THRUST_COMP_DEPR_IMPL0
Expand Down