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