diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index b55e978..9d3074d 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -8,7 +8,18 @@ import testing ; # type_traits in V1 seem to have two modes: standalone, triggered # by a command line option, and a regular. For now, just imitate -# regular +# regular + +project : requirements + # default to all warnings on: + all + # set warnings as errors for those compilers we know we get warning free: + gcc:-Wextra + gcc:on + intel:on + sun:on + msvc:on +; rule all-tests { local result ; diff --git a/test/aligned_storage_empy_test.cpp b/test/aligned_storage_empy_test.cpp index 23e62bf..536b06d 100644 --- a/test/aligned_storage_empy_test.cpp +++ b/test/aligned_storage_empy_test.cpp @@ -102,7 +102,7 @@ do_check(); do_check<__int64>(); #endif #ifdef BOOST_HAS_LONG_LONG -do_check(); +do_check(); #endif do_check(); diff --git a/test/aligned_storage_test.cpp b/test/aligned_storage_test.cpp index 372bac3..f4b1abb 100644 --- a/test/aligned_storage_test.cpp +++ b/test/aligned_storage_test.cpp @@ -27,6 +27,10 @@ inline void no_unused_warning(const volatile T&) { } +#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(BOOST_INTEL) +#pragma GCC diagnostic ignored "-Wmissing-braces" +#endif + template void do_check(const T&) { @@ -55,7 +59,7 @@ void do_check(const T&) #ifndef TEST_STD // Non-Tr1 behaviour: - typedef typename tt::aligned_storage::type t3; + typedef typename tt::aligned_storage(0UL)>::type t3; t3 as3 = { 0, }; must_be_pod pod3; no_unused_warning(as3); diff --git a/test/decay_test.cpp b/test/decay_test.cpp index 80d5099..f1ad1e4 100644 --- a/test/decay_test.cpp +++ b/test/decay_test.cpp @@ -16,6 +16,13 @@ #include #include +#ifdef BOOST_INTEL +// remark #383: value copied to temporary, reference to temporary used +// std::pair p2 = boost::make_pair( "foo", 1 ); +// ^ +#pragma warning(disable:383) +#endif + namespace boost { diff --git a/test/has_operator_new_test.cpp b/test/has_operator_new_test.cpp index 0fefd84..da57e48 100644 --- a/test/has_operator_new_test.cpp +++ b/test/has_operator_new_test.cpp @@ -7,6 +7,13 @@ #include "check_integral_constant.hpp" #include +#ifdef BOOST_INTEL +// remark #1720: function "class_with_new_op::operator new" has no corresponding member operator delete (to be called if an exception is thrown during initialization of an allocated object) +// void * operator new(std::size_t); +// ^ +#pragma warning(disable:1720) +#endif + struct class_with_new_op { void * operator new(std::size_t); }; diff --git a/test/is_abstract_test.cpp b/test/is_abstract_test.cpp index 1e75fa9..17c7bd2 100644 --- a/test/is_abstract_test.cpp +++ b/test/is_abstract_test.cpp @@ -21,71 +21,71 @@ struct TestA {}; struct TestB { virtual void foo(void) = 0; }; struct TestC { private: virtual void foo(void) = 0; }; -struct TestD : TestA {}; -struct TestE : TestB {}; -struct TestF : TestC {}; -struct TestG : TestB { virtual void foo(void) {} }; -struct TestH : TestC { private: virtual void foo(void) {} }; -struct TestI : TestB, TestC {}; -struct TestJ : TestI { virtual void foo(void) {} }; -struct TestK : TestB { virtual void foo(void); virtual void foo2(void) = 0; }; -struct TestL : TestK { virtual void foo2(void) {} }; -struct TestM : virtual TestB {}; -struct TestN : virtual TestC {}; -struct TestO : TestM, TestN {}; -struct TestP : TestO { virtual void foo(void) {} }; -struct TestQ : TestB { virtual void foo(void) = 0; }; -struct TestR : TestC { private: virtual void foo(void) = 0; }; +struct TestD : public TestA {}; +struct TestE : public TestB {}; +struct TestF : public TestC {}; +struct TestG : public TestB { virtual void foo(void) {} }; +struct TestH : public TestC { private: virtual void foo(void) {} }; +struct TestI : public TestB, public TestC {}; +struct TestJ : public TestI { virtual void foo(void) {} }; +struct TestK : public TestB { virtual void foo(void); virtual void foo2(void) = 0; }; +struct TestL : public TestK { virtual void foo2(void) {} }; +struct TestM : public virtual TestB {}; +struct TestN : public virtual TestC {}; +struct TestO : public TestM, public TestN {}; +struct TestP : public TestO { virtual void foo(void) {} }; +struct TestQ : public TestB { virtual void foo(void) = 0; }; +struct TestR : public TestC { private: virtual void foo(void) = 0; }; struct TestS { virtual void foo(void) {} }; struct TestT { virtual ~TestT(void) {} virtual void foo(void) {} }; -struct TestU : TestT { virtual void foo(void) = 0; }; -struct TestV : TestT { virtual void foo(void) {} }; +struct TestU : public TestT { virtual void foo(void) = 0; }; +struct TestV : public TestT { virtual void foo(void) {} }; struct TestW { virtual void foo1(void) = 0; virtual void foo2(void) = 0; }; -struct TestX : TestW { virtual void foo1(void) {} virtual void foo2(void) {} }; +struct TestX : public TestW { virtual void foo1(void) {} virtual void foo2(void) {} }; struct TestY { virtual ~TestY(void) = 0; }; struct TestZ { virtual ~TestZ(void) = 0; }; TestZ::~TestZ(void) {} -struct TestAA : TestZ { virtual ~TestAA(void) = 0; }; TestAA::~TestAA(void) {} -struct TestAB : TestAA { virtual ~TestAB(void) {} }; +struct TestAA : public TestZ { virtual ~TestAA(void) = 0; }; TestAA::~TestAA(void) {} +struct TestAB : public TestAA { virtual ~TestAB(void) {} }; struct TestAC { virtual void foo(void) = 0; }; void TestAC::foo(void) {} -struct TestAD : TestAC {}; -struct TestAE : TestAD { virtual void foo() {} }; -struct TestAF : TestAD { virtual void foo(); }; void TestAF::foo(void) {} -struct TestAG : virtual TestA {}; +struct TestAD : public TestAC {}; +struct TestAE : public TestAD { virtual void foo() {} }; +struct TestAF : public TestAD { virtual void foo(); }; void TestAF::foo(void) {} +struct TestAG : public virtual TestA {}; // template test types: template struct TTestA {}; template struct TTestB { virtual void foo(void) = 0; }; template struct TTestC { private: virtual void foo(void) = 0; }; -template struct TTestD : TTestA {}; -template struct TTestE : TTestB {}; -template struct TTestF : TTestC {}; -template struct TTestG : TTestB { virtual void foo(void) {} }; -template struct TTestH : TTestC { private: virtual void foo(void) {} }; -template struct TTestI : TTestB, TTestC {}; -template struct TTestJ : TTestI { virtual void foo(void) {} }; -template struct TTestK : TTestB { virtual void foo(void); virtual void foo2(void) = 0; }; -template struct TTestL : TTestK { virtual void foo2(void) {} }; -template struct TTestM : virtual TTestB {}; -template struct TTestN : virtual TTestC {}; -template struct TTestO : TTestM, TTestN {}; -template struct TTestP : TTestO { virtual void foo(void) {} }; -template struct TTestQ : TTestB { virtual void foo(void) = 0; }; -template struct TTestR : TTestC { private: virtual void foo(void) = 0; }; +template struct TTestD : public TTestA {}; +template struct TTestE : public TTestB {}; +template struct TTestF : public TTestC {}; +template struct TTestG : public TTestB { virtual void foo(void) {} }; +template struct TTestH : public TTestC { private: virtual void foo(void) {} }; +template struct TTestI : public TTestB, public TTestC {}; +template struct TTestJ : public TTestI { virtual void foo(void) {} }; +template struct TTestK : public TTestB { virtual void foo(void); virtual void foo2(void) = 0; }; +template struct TTestL : public TTestK { virtual void foo2(void) {} }; +template struct TTestM : public virtual TTestB {}; +template struct TTestN : public virtual TTestC {}; +template struct TTestO : public TTestM, public TTestN {}; +template struct TTestP : public TTestO { virtual void foo(void) {} }; +template struct TTestQ : public TTestB { virtual void foo(void) = 0; }; +template struct TTestR : public TTestC { private: virtual void foo(void) = 0; }; template struct TTestS { virtual void foo(void) {} }; template struct TTestT { virtual ~TTestT(void) {} virtual void foo(void) {} }; -template struct TTestU : TTestT { virtual void foo(void) = 0; }; -template struct TTestV : TTestT { virtual void foo(void) {} }; +template struct TTestU : public TTestT { virtual void foo(void) = 0; }; +template struct TTestV : public TTestT { virtual void foo(void) {} }; template struct TTestW { virtual void foo1(void) = 0; virtual void foo2(void) = 0; }; -template struct TTestX : TTestW { virtual void foo1(void) {} virtual void foo2(void) {} }; +template struct TTestX : public TTestW { virtual void foo1(void) {} virtual void foo2(void) {} }; template struct TTestY { virtual ~TTestY(void) = 0; }; template struct TTestZ { virtual ~TTestZ(void) = 0; }; template TTestZ::~TTestZ(void) {} -template struct TTestAA : TTestZ { virtual ~TTestAA(void) = 0; }; template TTestAA::~TTestAA(void) {} -template struct TTestAB : TTestAA { virtual ~TTestAB(void) {} }; +template struct TTestAA : public TTestZ { virtual ~TTestAA(void) = 0; }; template TTestAA::~TTestAA(void) {} +template struct TTestAB : public TTestAA { virtual ~TTestAB(void) {} }; template struct TTestAC { virtual void foo(void) = 0; }; template void TTestAC::foo(void) {} -template struct TTestAD : TTestAC {}; -template struct TTestAE : TTestAD { virtual void foo() {} }; -template struct TTestAF : TTestAD { virtual void foo(); }; template void TTestAF::foo(void) {} -template struct TTestAG : virtual TTestA {}; +template struct TTestAD : public TTestAC {}; +template struct TTestAE : public TTestAD { virtual void foo() {} }; +template struct TTestAF : public TTestAD { virtual void foo(); }; template void TTestAF::foo(void) {} +template struct TTestAG : public virtual TTestA {}; TT_TEST_BEGIN(is_abstract) diff --git a/test/is_convertible_test.cpp b/test/is_convertible_test.cpp index 564cff3..716831a 100644 --- a/test/is_convertible_test.cpp +++ b/test/is_convertible_test.cpp @@ -19,8 +19,8 @@ struct convertible_from }; struct base2 { }; -struct middle2 : virtual base2 { }; -struct derived2 : middle2 { }; +struct middle2 : public virtual base2 { }; +struct derived2 : public middle2 { }; TT_TEST_BEGIN(is_convertible) diff --git a/test/promote_enum_msvc_bug_test.cpp b/test/promote_enum_msvc_bug_test.cpp index 4d34bc0..3c6c9a7 100644 --- a/test/promote_enum_msvc_bug_test.cpp +++ b/test/promote_enum_msvc_bug_test.cpp @@ -17,6 +17,11 @@ #include "promote_util.hpp" +#ifdef BOOST_INTEL +// remark #1418: external function definition with no prior declaration +#pragma warning(disable:1418) +#endif + enum UIntEnum { UIntEnum_max = UINT_MAX }; diff --git a/test/promote_enum_test.cpp b/test/promote_enum_test.cpp old mode 100755 new mode 100644 index 58a103c..f94df5e --- a/test/promote_enum_test.cpp +++ b/test/promote_enum_test.cpp @@ -31,6 +31,11 @@ #include "promote_util.hpp" #include +#ifdef BOOST_INTEL +// remark #1418: external function definition with no prior declaration +#pragma warning(disable:1418) +#endif + enum IntEnum1 { IntEnum1_min = -5 , IntEnum1_max = 5 }; enum IntEnum2 { IntEnum2_min = SHRT_MIN, IntEnum2_max = SHRT_MAX }; enum IntEnum3 { IntEnum3_min = INT_MIN , IntEnum3_max = INT_MAX }; diff --git a/test/test.hpp b/test/test.hpp index f31452b..4e4470c 100644 --- a/test/test.hpp +++ b/test/test.hpp @@ -23,6 +23,17 @@ // We have to turn off warnings that occur within the test suite: #pragma warning(disable:4127) #endif +#ifdef BOOST_INTEL +// remark #1418: external function definition with no prior declaration +// remark #981: operands are evaluated in unspecified order +#pragma warning(disable:1418 981) +#endif + +#ifdef BOOST_INTEL +// turn off warnings from this header: +#pragma warning(push) +#pragma warning(disable:444) +#endif // // basic configuration: @@ -289,7 +300,7 @@ struct VB virtual ~VB(){}; }; -struct VD : VB +struct VD : public VB { ~VD(){}; }; @@ -356,21 +367,21 @@ struct polymorphic_base virtual void method(); }; -struct polymorphic_derived1 : polymorphic_base +struct polymorphic_derived1 : public polymorphic_base { }; -struct polymorphic_derived2 : polymorphic_base +struct polymorphic_derived2 : public polymorphic_base { virtual void method(); }; -struct virtual_inherit1 : virtual Base { }; -struct virtual_inherit2 : virtual_inherit1 { }; +struct virtual_inherit1 : public virtual Base { }; +struct virtual_inherit2 : public virtual_inherit1 { }; struct virtual_inherit3 : private virtual Base {}; -struct virtual_inherit4 : virtual boost::noncopyable {}; -struct virtual_inherit5 : virtual int_convertible {}; -struct virtual_inherit6 : virtual Base { virtual ~virtual_inherit6()throw(); }; +struct virtual_inherit4 : public virtual boost::noncopyable {}; +struct virtual_inherit5 : public virtual int_convertible {}; +struct virtual_inherit6 : public virtual Base { virtual ~virtual_inherit6()throw(); }; typedef void foo0_t(); typedef void foo1_t(int); @@ -413,6 +424,9 @@ protected: wrap& operator=(const wrap&); }; +#ifdef BOOST_INTEL +#pragma warning(pop) +#endif #endif