Fix a few more compiler warnings.

[SVN r65273]
This commit is contained in:
John Maddock
2010-09-04 17:36:23 +00:00
parent d06a16e0e9
commit fd67e7f2db
4 changed files with 26 additions and 9 deletions

View File

@ -12,6 +12,18 @@
# include <boost/type_traits/alignment_of.hpp>
#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

View File

@ -104,8 +104,11 @@ BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<float,convertible_from<float
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<float,convertible_from<float const&> >::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<float,convertible_from<float&> >::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<float,convertible_from<char> >::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<float,convertible_from<char const&> >::value), true);
#endif
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<float,convertible_from<char&> >::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<char,convertible_from<char> >::value), true);

View File

@ -30,7 +30,10 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<foo0_t>::value, f
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<const int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<const int[2] >::value, false);
#ifndef __IBMCPP__
// this test may not be strictly legal:
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<const int[] >::value, false);
#endif
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<void>::value, false);
#ifdef BOOST_TT_TEST_MS_FUNC_SIGS

View File

@ -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; }
};