Removed more C++98/03 compatibility

This commit is contained in:
Phil Nash 2017-04-25 12:40:52 +01:00
parent 5c8ea03cc8
commit 79650e44f4
6 changed files with 1 additions and 52 deletions

View File

@ -19,8 +19,6 @@
#ifdef __clang__ #ifdef __clang__
# pragma clang diagnostic push # pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wpadded" # pragma clang diagnostic ignored "-Wpadded"
# pragma clang diagnostic ignored "-Wc++98-compat"
# pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
#endif #endif
namespace Catch { namespace Catch {

View File

@ -7,7 +7,6 @@
*/ */
#ifdef __clang__ #ifdef __clang__
# pragma clang diagnostic ignored "-Wpadded" # pragma clang diagnostic ignored "-Wpadded"
# pragma clang diagnostic ignored "-Wc++98-compat"
#endif #endif
#include "catch.hpp" #include "catch.hpp"

View File

@ -29,12 +29,6 @@ TEST_CASE( "toString(enum w/operator<<)", "[toString][enum]" ) {
CHECK( Catch::toString(e1) == "E2{1}" ); CHECK( Catch::toString(e1) == "E2{1}" );
} }
#if defined(CATCH_CPP11_OR_GREATER)
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wc++98-compat"
#endif
// Enum class without user-provided stream operator // Enum class without user-provided stream operator
enum class EnumClass1 { EnumClass1Value0, EnumClass1Value1 }; enum class EnumClass1 { EnumClass1Value0, EnumClass1Value1 };
@ -69,8 +63,3 @@ TEST_CASE( "toString(enum class w/operator<<)", "[toString][enum][enumClass][c++
CHECK( Catch::toString(e3) == "Unknown enum value 10" ); CHECK( Catch::toString(e3) == "Unknown enum value 10" );
} }
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CATCH_CPP11_OR_GREATER

View File

@ -1,11 +1,6 @@
#include "catch.hpp" #include "catch.hpp"
#ifdef CATCH_CPP11_OR_GREATER #include <tuple>
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wc++98-compat"
#endif
TEST_CASE( "tuple<>", "[toString][tuple][c++11][.]" ) TEST_CASE( "tuple<>", "[toString][tuple][c++11][.]" )
{ {
@ -42,18 +37,10 @@ TEST_CASE( "tuple<tuple<int>,tuple<>,float>", "[toString][tuple][c++11][.]" )
CHECK( "{ { 42 }, { }, 1.2f }" == Catch::toString(value) ); CHECK( "{ { 42 }, { }, 1.2f }" == Catch::toString(value) );
} }
#ifdef CATCH_CONFIG_CPP11_NULLPTR
TEST_CASE( "tuple<nullptr,int,const char *>", "[toString][tuple][c++11][.]" ) TEST_CASE( "tuple<nullptr,int,const char *>", "[toString][tuple][c++11][.]" )
{ {
typedef std::tuple<std::nullptr_t,int,const char *> type; typedef std::tuple<std::nullptr_t,int,const char *> type;
type value { nullptr, 42, "Catch me" }; type value { nullptr, 42, "Catch me" };
CHECK( "{ nullptr, 42, \"Catch me\" }" == Catch::toString(value) ); CHECK( "{ nullptr, 42, \"Catch me\" }" == Catch::toString(value) );
} }
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif /* #ifdef CATCH_CPP11_OR_GREATER */

View File

@ -23,16 +23,6 @@ TEST_CASE( "vector<string> -> toString", "[toString][vector]" )
REQUIRE( Catch::toString(vv) == "{ \"hello\", \"world\" }" ); REQUIRE( Catch::toString(vv) == "{ \"hello\", \"world\" }" );
} }
#if defined(CATCH_CPP11_OR_GREATER)
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wc++98-compat"
#endif
/*
Note: These tests *can* be made to work with C++ < 11, but the
allocator is a lot more work...
*/
namespace { namespace {
/* Minimal Allocator */ /* Minimal Allocator */
template<typename T> template<typename T>
@ -70,8 +60,3 @@ TEST_CASE( "vec<vec<string,alloc>> -> toString", "[toString][vector,allocator][c
v.push_back( inner { "world" } ); v.push_back( inner { "world" } );
REQUIRE( Catch::toString(v) == "{ { \"hello\" }, { \"world\" } }" ); REQUIRE( Catch::toString(v) == "{ { \"hello\" }, { \"world\" } }" );
} }
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CATCH_CPP11_OR_GREATER

View File

@ -14,11 +14,6 @@
#include "catch.hpp" #include "catch.hpp"
#ifdef __clang__
#pragma clang diagnostic ignored "-Wc++98-compat"
#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
#endif
namespace Catch namespace Catch
{ {
template<> template<>
@ -385,8 +380,6 @@ TEST_CASE( "pointer to class", "[Tricky]" )
REQUIRE( p == 0 ); REQUIRE( p == 0 );
} }
#ifdef CATCH_CONFIG_CPP11_NULLPTR
#include <memory> #include <memory>
TEST_CASE( "null_ptr", "[Tricky][c++11][.]" ) TEST_CASE( "null_ptr", "[Tricky][c++11][.]" )
@ -395,8 +388,6 @@ TEST_CASE( "null_ptr", "[Tricky][c++11][.]" )
REQUIRE(ptr.get() == nullptr); REQUIRE(ptr.get() == nullptr);
} }
#endif
TEST_CASE( "X/level/0/a", "[Tricky]" ) { SUCCEED(""); } TEST_CASE( "X/level/0/a", "[Tricky]" ) { SUCCEED(""); }
TEST_CASE( "X/level/0/b", "[Tricky][fizz]" ){ SUCCEED(""); } TEST_CASE( "X/level/0/b", "[Tricky][fizz]" ){ SUCCEED(""); }
TEST_CASE( "X/level/1/a", "[Tricky]" ) { SUCCEED(""); } TEST_CASE( "X/level/1/a", "[Tricky]" ) { SUCCEED(""); }