From 78c92e68aa350f1a971fbcf8cad70f4187d79caf Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 27 Aug 2012 21:48:15 +0100 Subject: [PATCH] Got rid of some warnings --- include/internal/catch_commandline.hpp | 6 +++--- include/internal/catch_test_spec.h | 11 ++++++++++- single_include/catch.hpp | 19 ++++++++++++++----- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index 0778eb5a..31ca3748 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -317,7 +317,7 @@ namespace Catch { return "!TBD"; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( const Command&, ConfigData& config ) { config.includeWhichResults = Include::SuccessfulResults; } }; @@ -335,7 +335,7 @@ namespace Catch { return "!TBD"; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( const Command&, ConfigData& config ) { config.shouldDebugBreak = true; } }; @@ -397,7 +397,7 @@ namespace Catch { return "!TBD"; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( const Command&, ConfigData& config ) { config.allowThrows = false; } }; diff --git a/include/internal/catch_test_spec.h b/include/internal/catch_test_spec.h index 1effad6f..4aa03855 100644 --- a/include/internal/catch_test_spec.h +++ b/include/internal/catch_test_spec.h @@ -50,6 +50,11 @@ namespace Catch { } private: +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunreachable-code" +#endif + bool isMatch( const TestCaseInfo& testCase ) const { const std::string& name = testCase.getName(); @@ -63,9 +68,13 @@ namespace Catch { case WildcardAtBothEnds: return contains( name, m_stringToMatch ); } - + throw std::logic_error( "Unhandled wildcard type" ); } +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + std::string m_stringToMatch; IfFilterMatches::DoWhat m_filterType; WildcardPosition m_wildcardPosition; diff --git a/single_include/catch.hpp b/single_include/catch.hpp index fdb2b262..559ddd38 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,5 +1,5 @@ /* - * Generated: 2012-08-27 21:42:22.556899 + * Generated: 2012-08-27 21:47:53.626062 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -2271,6 +2271,11 @@ namespace Catch { } private: +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunreachable-code" +#endif + bool isMatch( const TestCaseInfo& testCase ) const { const std::string& name = testCase.getName(); @@ -2284,9 +2289,13 @@ namespace Catch { case WildcardAtBothEnds: return contains( name, m_stringToMatch ); } - + throw std::logic_error( "Unhandled wildcard type" ); } +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + std::string m_stringToMatch; IfFilterMatches::DoWhat m_filterType; WildcardPosition m_wildcardPosition; @@ -2780,7 +2789,7 @@ namespace Catch { return "!TBD"; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( const Command&, ConfigData& config ) { config.includeWhichResults = Include::SuccessfulResults; } }; @@ -2798,7 +2807,7 @@ namespace Catch { return "!TBD"; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( const Command&, ConfigData& config ) { config.shouldDebugBreak = true; } }; @@ -2860,7 +2869,7 @@ namespace Catch { return "!TBD"; } - virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { + virtual void parseIntoConfig( const Command&, ConfigData& config ) { config.allowThrows = false; } };