From fd67e7f2dbdc2f3af942a967b6f3490319005111 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 4 Sep 2010 17:36:23 +0000 Subject: [PATCH] Fix a few more compiler warnings. [SVN r65273] --- test/alignment_of_test.cpp | 12 ++++++++++++ test/is_convertible_test.cpp | 3 +++ test/is_member_func_test.cpp | 3 +++ test/test.hpp | 17 ++++++++--------- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/test/alignment_of_test.cpp b/test/alignment_of_test.cpp index 85a4551..7faaf84 100644 --- a/test/alignment_of_test.cpp +++ b/test/alignment_of_test.cpp @@ -12,6 +12,18 @@ # include #endif +// +// Need to defined some member function for empty_UDT, +// we don't want to put these in the test.hpp as that +// causes overly-clever compilers to figure out that they can't throw +// which in turn breaks other tests. +// +empty_UDT::empty_UDT(){} +empty_UDT::~empty_UDT(){} +empty_UDT::empty_UDT(const empty_UDT&){} +empty_UDT& empty_UDT::operator=(const empty_UDT&){ return *this; } +bool empty_UDT::operator==(const empty_UDT&)const{ return true; } + // // VC++ emits an awful lot of warnings unless we define these: #ifdef BOOST_MSVC diff --git a/test/is_convertible_test.cpp b/test/is_convertible_test.cpp index 716831a..e88a2ef 100644 --- a/test/is_convertible_test.cpp +++ b/test/is_convertible_test.cpp @@ -104,8 +104,11 @@ BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible >::value), true); BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible >::value), true); +#if !(defined(__GNUC__) && (__GNUC__ < 4)) +// GCC 3.x emits warnings here, which causes the tests to fail when we compile with warnings-as-errors: BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible >::value), true); BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible >::value), true); +#endif BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible >::value), false); BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible >::value), true); diff --git a/test/is_member_func_test.cpp b/test/is_member_func_test.cpp index 59927b4..4d39892 100644 --- a/test/is_member_func_test.cpp +++ b/test/is_member_func_test.cpp @@ -30,7 +30,10 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, f BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, false); +#ifndef __IBMCPP__ +// this test may not be strictly legal: BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, false); +#endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, false); #ifdef BOOST_TT_TEST_MS_FUNC_SIGS diff --git a/test/test.hpp b/test/test.hpp index 4e4470c..d1facd2 100644 --- a/test/test.hpp +++ b/test/test.hpp @@ -167,8 +167,8 @@ void name(){ TRANSFORM_CHECK(type, BOOST_DUMMY_MACRO_PARAM, BOOST_DUMMY_MACRO_PA enum enum_UDT{ one, two, three }; struct UDT { - UDT(){}; - ~UDT(){}; + UDT(); + ~UDT(); UDT(const UDT&); UDT& operator=(const UDT&); int i; @@ -217,12 +217,11 @@ typedef const r_type cr_type; struct POD_UDT { int x; }; struct empty_UDT { - empty_UDT(){}; - empty_UDT(const empty_UDT&){}; - ~empty_UDT(){}; - empty_UDT& operator=(const empty_UDT&){ return *this; } - bool operator==(const empty_UDT&)const - { return true; } + empty_UDT(); + empty_UDT(const empty_UDT&); + ~empty_UDT(); + empty_UDT& operator=(const empty_UDT&); + bool operator==(const empty_UDT&)const; }; struct empty_POD_UDT { @@ -251,7 +250,7 @@ struct nothrow_copy_UDT nothrow_copy_UDT(); nothrow_copy_UDT(const nothrow_copy_UDT&)throw(); ~nothrow_copy_UDT(){}; - nothrow_copy_UDT& operator=(const nothrow_copy_UDT&){ return *this; } + nothrow_copy_UDT& operator=(const nothrow_copy_UDT&); bool operator==(const nothrow_copy_UDT&)const { return true; } };