Solved compiler warnings C5026 and C5027 for VS2015.

This commit is contained in:
RLangendam 2016-10-08 17:38:33 +02:00
parent 88732e85b2
commit f1729d5aff
6 changed files with 23 additions and 0 deletions

View File

@ -34,6 +34,14 @@ namespace Catch {
No No
}; }; }; };
#ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
#define CATCH_CONFIG_CPP11_NON_MOVABLE(name) \
name(name&&) = delete; \
name& operator=(name&&) = delete;
#else
#define CATCH_CONFIG_CPP11_NON_MOVABLE(name)
#endif
class NonCopyable { class NonCopyable {
#ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS #ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
NonCopyable( NonCopyable const& ) = delete; NonCopyable( NonCopyable const& ) = delete;

View File

@ -39,6 +39,9 @@ namespace Matchers {
virtual Ptr<Matcher<ExpressionT> > clone() const { virtual Ptr<Matcher<ExpressionT> > clone() const {
return Ptr<Matcher<ExpressionT> >( new DerivedT( static_cast<DerivedT const&>( *this ) ) ); return Ptr<Matcher<ExpressionT> >( new DerivedT( static_cast<DerivedT const&>( *this ) ) );
} }
MatcherImpl() {};
CATCH_CONFIG_CPP11_NON_MOVABLE(MatcherImpl)
}; };
namespace Generic { namespace Generic {

View File

@ -82,6 +82,8 @@ namespace Catch {
} }
mutable unsigned int m_rc; mutable unsigned int m_rc;
CATCH_CONFIG_CPP11_NON_MOVABLE(SharedImpl)
}; };
} // end namespace Catch } // end namespace Catch

View File

@ -56,6 +56,10 @@ namespace Catch {
virtual std::string getDescription() const { virtual std::string getDescription() const {
return T::getDescription(); return T::getDescription();
} }
public:
ReporterFactory() {}
CATCH_CONFIG_CPP11_NON_MOVABLE(ReporterFactory)
}; };
public: public:
@ -63,6 +67,8 @@ namespace Catch {
ReporterRegistrar( std::string const& name ) { ReporterRegistrar( std::string const& name ) {
getMutableRegistryHub().registerReporter( name, new ReporterFactory() ); getMutableRegistryHub().registerReporter( name, new ReporterFactory() );
} }
CATCH_CONFIG_CPP11_NON_MOVABLE(ReporterRegistrar)
}; };
template<typename T> template<typename T>

View File

@ -240,6 +240,8 @@ namespace Catch {
virtual bool assertionEnded( AssertionStats const& ) CATCH_OVERRIDE { virtual bool assertionEnded( AssertionStats const& ) CATCH_OVERRIDE {
return false; return false;
} }
CATCH_CONFIG_CPP11_NON_MOVABLE(TestEventListenerBase)
}; };
} // end namespace Catch } // end namespace Catch

View File

@ -123,6 +123,8 @@ public: // IStreamingReporter
return this; return this;
} }
MultipleReporters() {}
CATCH_CONFIG_CPP11_NON_MOVABLE(MultipleReporters)
}; };
Ptr<IStreamingReporter> addReporter( Ptr<IStreamingReporter> const& existingReporter, Ptr<IStreamingReporter> const& additionalReporter ) { Ptr<IStreamingReporter> addReporter( Ptr<IStreamingReporter> const& existingReporter, Ptr<IStreamingReporter> const& additionalReporter ) {