diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h index 545276e7..583bb607 100644 --- a/include/internal/catch_common.h +++ b/include/internal/catch_common.h @@ -34,6 +34,14 @@ namespace Catch { 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 { #ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS NonCopyable( NonCopyable const& ) = delete; diff --git a/include/internal/catch_matchers.hpp b/include/internal/catch_matchers.hpp index ab8fec15..c29eac35 100644 --- a/include/internal/catch_matchers.hpp +++ b/include/internal/catch_matchers.hpp @@ -39,6 +39,9 @@ namespace Matchers { virtual Ptr > clone() const { return Ptr >( new DerivedT( static_cast( *this ) ) ); } + + MatcherImpl() {}; + CATCH_CONFIG_CPP11_NON_MOVABLE(MatcherImpl) }; namespace Generic { diff --git a/include/internal/catch_ptr.hpp b/include/internal/catch_ptr.hpp index 940e5d19..fcc663bb 100644 --- a/include/internal/catch_ptr.hpp +++ b/include/internal/catch_ptr.hpp @@ -82,6 +82,8 @@ namespace Catch { } mutable unsigned int m_rc; + + CATCH_CONFIG_CPP11_NON_MOVABLE(SharedImpl) }; } // end namespace Catch diff --git a/include/internal/catch_reporter_registrars.hpp b/include/internal/catch_reporter_registrars.hpp index 7bd7b610..1dbd910b 100644 --- a/include/internal/catch_reporter_registrars.hpp +++ b/include/internal/catch_reporter_registrars.hpp @@ -56,6 +56,10 @@ namespace Catch { virtual std::string getDescription() const { return T::getDescription(); } + + public: + ReporterFactory() {} + CATCH_CONFIG_CPP11_NON_MOVABLE(ReporterFactory) }; public: @@ -63,6 +67,8 @@ namespace Catch { ReporterRegistrar( std::string const& name ) { getMutableRegistryHub().registerReporter( name, new ReporterFactory() ); } + + CATCH_CONFIG_CPP11_NON_MOVABLE(ReporterRegistrar) }; template diff --git a/include/reporters/catch_reporter_bases.hpp b/include/reporters/catch_reporter_bases.hpp index cfc28f29..624fa3ca 100644 --- a/include/reporters/catch_reporter_bases.hpp +++ b/include/reporters/catch_reporter_bases.hpp @@ -240,6 +240,8 @@ namespace Catch { virtual bool assertionEnded( AssertionStats const& ) CATCH_OVERRIDE { return false; } + + CATCH_CONFIG_CPP11_NON_MOVABLE(TestEventListenerBase) }; } // end namespace Catch diff --git a/include/reporters/catch_reporter_multi.hpp b/include/reporters/catch_reporter_multi.hpp index 7fc08f69..e8e9f0a3 100644 --- a/include/reporters/catch_reporter_multi.hpp +++ b/include/reporters/catch_reporter_multi.hpp @@ -123,6 +123,8 @@ public: // IStreamingReporter return this; } + MultipleReporters() {} + CATCH_CONFIG_CPP11_NON_MOVABLE(MultipleReporters) }; Ptr addReporter( Ptr const& existingReporter, Ptr const& additionalReporter ) {