diff options
| author | Martin Hořeňovský | 2020-05-12 13:51:58 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2020-05-12 23:56:08 +0200 |
| commit | 25282473514174bf306dd86657d4aee0609cda3f (patch) | |
| tree | b1b197e7c58a169b38a792e308285833ec4108d2 /src | |
| parent | f56832d3eadb9096ac0798bfeabec8a34c29542e (diff) | |
| download | catch3-25282473514174bf306dd86657d4aee0609cda3f.tar.gz | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/catch2/catch_message.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
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__ ) /////////////////////////////////////////////////////////////////////////////// |