From 25282473514174bf306dd86657d4aee0609cda3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Tue, 12 May 2020 13:51:58 +0200 Subject: [PATCH] Delete Capturer's smf As part of `-Wdeprecated-copy-dtor` sweep, I noticed that Capturer's copies are defaulted. Given that the class would likely break horribly in the event of actual copy happening, they are now deleted. --- src/catch2/catch_message.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/catch2/catch_message.hpp b/src/catch2/catch_message.hpp index 26b314dd..b302ee39 100644 --- a/src/catch2/catch_message.hpp +++ b/src/catch2/catch_message.hpp @@ -62,6 +62,10 @@ namespace Catch { size_t m_captured = 0; public: Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names ); + + Capturer(Capturer const&) = delete; + Capturer& operator=(Capturer const&) = delete; + ~Capturer(); void captureValue( size_t index, std::string const& value ); @@ -90,7 +94,7 @@ namespace Catch { /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_CAPTURE( varName, macroName, ... ) \ - auto varName = Catch::Capturer( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info, #__VA_ARGS__ ); \ + Catch::Capturer varName( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info, #__VA_ARGS__ ); \ varName.captureValues( 0, __VA_ARGS__ ) ///////////////////////////////////////////////////////////////////////////////