mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-27 15:09:33 +00:00
Conditionally removes usage of deprecated features
-add macros to test for C++ version and features to catch_compiler_capabilities.hpp - replaces dynamic exception specifications (deprecated) with noexcept in C++ Version >= 11 - defines defaulted copy constructor/move constructors/assignment in C++ Version >= 11 since their implicit generation is deprecated under some circumstances. - fixes #259
This commit is contained in:
parent
ba13f3f098
commit
ce6598599b
13 changed files with 103 additions and 10 deletions
|
@ -81,5 +81,27 @@
|
|||
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// C++ language feature support
|
||||
|
||||
// detect language version:
|
||||
#if (__cplusplus == 201103L)
|
||||
# define CATCH_CPP11
|
||||
# define CATCH_CPP11_OR_GREATER
|
||||
#elif (__cplusplus >= 201103L)
|
||||
# define CATCH_CPP11_OR_GREATER
|
||||
#endif
|
||||
|
||||
// noexcept support:
|
||||
#ifdef CATCH_CPP11_OR_GREATER
|
||||
# if (__has_feature(cxx_noexcept))
|
||||
# define CATCH_NOEXCEPT noexcept
|
||||
# define CATCH_NOEXCEPT_IS(x) noexcept(x)
|
||||
# endif
|
||||
#else
|
||||
# define CATCH_NOEXCEPT throw()
|
||||
# define CATCH_NOEXCEPT_IS(x)
|
||||
#endif
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue