Fixed an issue on some compilers with implicit conversion from nullptr to Ptr

- also cleaned up some warnings to do with CATCH_NULL
This commit is contained in:
Phil Nash 2015-07-03 18:27:36 +01:00
parent 62e517f833
commit d6f1446e4e
6 changed files with 13 additions and 5 deletions

View File

@ -78,7 +78,7 @@ namespace Catch {
virtual ~RunContext() { virtual ~RunContext() {
m_reporter->testRunEnded( TestRunStats( m_runInfo, m_totals, aborting() ) ); m_reporter->testRunEnded( TestRunStats( m_runInfo, m_totals, aborting() ) );
m_context.setRunner( m_prevRunner ); m_context.setRunner( m_prevRunner );
m_context.setConfig( CATCH_NULL ); m_context.setConfig( Ptr<IConfig const>() );
m_context.setResultCapture( m_prevResultCapture ); m_context.setResultCapture( m_prevResultCapture );
m_context.setConfig( m_prevConfig ); m_context.setConfig( m_prevConfig );
} }

View File

@ -9,6 +9,9 @@
#include "catch.hpp" #include "catch.hpp"
#include "catch_test_spec_parser.hpp" #include "catch_test_spec_parser.hpp"
#ifdef __clang__
# pragma clang diagnostic ignored "-Wc++98-compat"
#endif
inline Catch::TestCase fakeTestCase( const char* name, const char* desc = "" ){ return Catch::makeTestCase( CATCH_NULL, "", name, desc, CATCH_INTERNAL_LINEINFO ); } inline Catch::TestCase fakeTestCase( const char* name, const char* desc = "" ){ return Catch::makeTestCase( CATCH_NULL, "", name, desc, CATCH_INTERNAL_LINEINFO ); }

View File

@ -6,7 +6,8 @@
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/ */
#ifdef __clang__ #ifdef __clang__
#pragma clang diagnostic ignored "-Wpadded" # pragma clang diagnostic ignored "-Wpadded"
# pragma clang diagnostic ignored "-Wc++98-compat"
#endif #endif
#include "catch.hpp" #include "catch.hpp"

View File

@ -7,7 +7,8 @@
*/ */
#ifdef __clang__ #ifdef __clang__
#pragma clang diagnostic ignored "-Wpadded" # pragma clang diagnostic ignored "-Wpadded"
# pragma clang diagnostic ignored "-Wc++98-compat"
#endif #endif
#include "internal/catch_test_case_tracker.hpp" #include "internal/catch_test_case_tracker.hpp"

View File

@ -1,2 +1,4 @@
// This file is only here to verify (to the extent possible) the self sufficiency of the header // This file is only here to verify (to the extent possible) the self sufficiency of the header
#include "catch_suppress_warnings.h"
#include "catch_xmlwriter.hpp" #include "catch_xmlwriter.hpp"
#include "catch_reenable_warnings.h"

View File

@ -16,8 +16,9 @@ CATCH_REGISTER_TAG_ALIAS( "[@tricky]", "[tricky]~[.]" )
#ifdef __clang__ #ifdef __clang__
#pragma clang diagnostic ignored "-Wpadded" # pragma clang diagnostic ignored "-Wpadded"
#pragma clang diagnostic ignored "-Wweak-vtables" # pragma clang diagnostic ignored "-Wweak-vtables"
# pragma clang diagnostic ignored "-Wc++98-compat"
#endif #endif