Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65273 - trunk/libs/type_traits/test
From: john_at_[hidden]
Date: 2010-09-04 13:36:27


Author: johnmaddock
Date: 2010-09-04 13:36:23 EDT (Sat, 04 Sep 2010)
New Revision: 65273
URL: http://svn.boost.org/trac/boost/changeset/65273

Log:
Fix a few more compiler warnings.
Text files modified:
   trunk/libs/type_traits/test/alignment_of_test.cpp | 12 ++++++++++++
   trunk/libs/type_traits/test/is_convertible_test.cpp | 3 +++
   trunk/libs/type_traits/test/is_member_func_test.cpp | 3 +++
   trunk/libs/type_traits/test/test.hpp | 17 ++++++++---------
   4 files changed, 26 insertions(+), 9 deletions(-)

Modified: trunk/libs/type_traits/test/alignment_of_test.cpp
==============================================================================
--- trunk/libs/type_traits/test/alignment_of_test.cpp (original)
+++ trunk/libs/type_traits/test/alignment_of_test.cpp 2010-09-04 13:36:23 EDT (Sat, 04 Sep 2010)
@@ -13,6 +13,18 @@
 #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
 # pragma warning(disable:4244)

Modified: trunk/libs/type_traits/test/is_convertible_test.cpp
==============================================================================
--- trunk/libs/type_traits/test/is_convertible_test.cpp (original)
+++ trunk/libs/type_traits/test/is_convertible_test.cpp 2010-09-04 13:36:23 EDT (Sat, 04 Sep 2010)
@@ -104,8 +104,11 @@
 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);

Modified: trunk/libs/type_traits/test/is_member_func_test.cpp
==============================================================================
--- trunk/libs/type_traits/test/is_member_func_test.cpp (original)
+++ trunk/libs/type_traits/test/is_member_func_test.cpp 2010-09-04 13:36:23 EDT (Sat, 04 Sep 2010)
@@ -30,7 +30,10 @@
 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

Modified: trunk/libs/type_traits/test/test.hpp
==============================================================================
--- trunk/libs/type_traits/test/test.hpp (original)
+++ trunk/libs/type_traits/test/test.hpp 2010-09-04 13:36:23 EDT (Sat, 04 Sep 2010)
@@ -167,8 +167,8 @@
 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 @@
 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 @@
    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; }
 };


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk