mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-16 18:52:25 +01:00
Add CATCH_NOEXCEPT macro
This commit is contained in:
parent
ba13f3f098
commit
21edb3c7a4
@ -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
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
namespace Catch {
|
||||
NonCopyable::~NonCopyable() {}
|
||||
IShared::~IShared() {}
|
||||
StreamBufBase::~StreamBufBase() throw() {}
|
||||
StreamBufBase::~StreamBufBase() CATCH_NOEXCEPT {}
|
||||
IContext::~IContext() {}
|
||||
IResultCapture::~IResultCapture() {}
|
||||
ITestCase::~ITestCase() {}
|
||||
|
@ -18,9 +18,9 @@ namespace Catch {
|
||||
public:
|
||||
NotImplementedException( SourceLineInfo const& lineInfo );
|
||||
|
||||
virtual ~NotImplementedException() throw() {}
|
||||
virtual ~NotImplementedException() CATCH_NOEXCEPT {}
|
||||
|
||||
virtual const char* what() const throw();
|
||||
virtual const char* what() const CATCH_NOEXCEPT;
|
||||
|
||||
private:
|
||||
std::string m_what;
|
||||
|
@ -21,7 +21,7 @@ namespace Catch {
|
||||
m_what = oss.str();
|
||||
}
|
||||
|
||||
const char* NotImplementedException::what() const throw() {
|
||||
const char* NotImplementedException::what() const CATCH_NOEXCEPT {
|
||||
return m_what.c_str();
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ namespace Catch {
|
||||
setp( data, data + sizeof(data) );
|
||||
}
|
||||
|
||||
~StreamBufImpl() throw() {
|
||||
~StreamBufImpl() CATCH_NOEXCEPT {
|
||||
sync();
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ namespace Catch {
|
||||
|
||||
class StreamBufBase : public std::streambuf {
|
||||
public:
|
||||
virtual ~StreamBufBase() throw();
|
||||
virtual ~StreamBufBase() CATCH_NOEXCEPT;
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user