From 995370c90409a6aa860054beca5c404970058b8a Mon Sep 17 00:00:00 2001 From: Daniel James Date: Tue, 19 Sep 2017 12:24:36 +0100 Subject: [PATCH 1/4] Use is_zero workaround on clang The same warning appears on clang for windows, but the workaround wasn't used because the gcc macro wasn't defined. --- include/boost/functional/hash/detail/hash_float.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/functional/hash/detail/hash_float.hpp b/include/boost/functional/hash/detail/hash_float.hpp index 9fb8168..1816c57 100644 --- a/include/boost/functional/hash/detail/hash_float.hpp +++ b/include/boost/functional/hash/detail/hash_float.hpp @@ -241,7 +241,7 @@ namespace boost template inline bool is_zero(T v) { -#if !defined(__GNUC__) +#if !defined(__GNUC__) && !defined(__clang__) return v == 0; #else // GCC's '-Wfloat-equal' will complain about comparing From ca954fb7c94f25ad73482c7125630684e3373364 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Mon, 2 Oct 2017 13:42:23 +0100 Subject: [PATCH 2/4] Initial explicit-failures-markup.xml --- meta/explicit-failures-markup.xml | 116 ++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 meta/explicit-failures-markup.xml diff --git a/meta/explicit-failures-markup.xml b/meta/explicit-failures-markup.xml new file mode 100644 index 0000000..d551259 --- /dev/null +++ b/meta/explicit-failures-markup.xml @@ -0,0 +1,116 @@ + + + + + + + + + Probably broken const conversion with that compiler. + + + + + + + + + + + + + + This compiler is currently not supported. + + + + + + + + + + + + hash_value is not overloaded for arrays for older versions + of Visual C++. There is a work around so that + boost::hash<T[N]>, boost::hash_combine and boost::hash_range + work. + + + + + + + + + + + + + + + + + On these compilers the wrong overload of hash_value is called + when the argument is a hash function pointer. So calling + hash_value doesn't work but boost::hash does work (and it's + recommended that user never call hash_value directly so this + shouldn't be a problem). + + + + + + + + + This platform has poor support for long double so + the hash function perform poorly for values out of the range + of double or if they differ at a greater precision + that double is capable of representing. + + + + + + + + + + These examples only work on compilers with support for ADL. + It is possible to work around this, but I wanted to keep the + example code as clean as possible. + + + + + + + + It appears that Borland doesn't find friend functions defined + in a class by ADL. This is easily fixed but this example is + meant to show the typical way of customising boost::hash, not + the portable way. + + + + + + + + The test demonstrates a Borland bug - functions that aren't + in a namespace don't appear to be found by ADL. + + + + + + + + Debug containers aren't supported on Apple's version of gcc 4.2. + + + + From 5d83851b5c15086af3ca8a81d21764aa7a1d09e3 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Mon, 2 Oct 2017 23:31:54 +0100 Subject: [PATCH 3/4] Remove schema stuff, as it doesn't work --- meta/explicit-failures-markup.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/meta/explicit-failures-markup.xml b/meta/explicit-failures-markup.xml index d551259..413753d 100644 --- a/meta/explicit-failures-markup.xml +++ b/meta/explicit-failures-markup.xml @@ -1,6 +1,5 @@ - + From 35d79a36c908cd14ac51885140453b9c2aa581d5 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Fri, 20 Oct 2017 02:47:23 +0100 Subject: [PATCH 4/4] Suppress warnings about std::auto_ptr in factory tests They're testing that the library works with std::auto_ptr, the library itself doesn't use it. --- factory/test/factory.cpp | 15 ++++++++++++--- factory/test/factory_with_none_t.cpp | 10 ++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/factory/test/factory.cpp b/factory/test/factory.cpp index 76afe7b..6894481 100644 --- a/factory/test/factory.cpp +++ b/factory/test/factory.cpp @@ -1,7 +1,7 @@ /*============================================================================= Copyright (c) 2007 Tobias Schwinger - - Use modification and distribution are subject to the Boost Software + + Use modification and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt). ==============================================================================*/ @@ -11,7 +11,7 @@ #include -class sum +class sum { int val_sum; public: @@ -20,6 +20,12 @@ class sum operator int() const { return this->val_sum; } }; +// Suppress warnings about std::auto_ptr. +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + int main() { int one = 1, two = 2; @@ -42,3 +48,6 @@ int main() return boost::report_errors(); } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif diff --git a/factory/test/factory_with_none_t.cpp b/factory/test/factory_with_none_t.cpp index 168dc26..bdca2c2 100644 --- a/factory/test/factory_with_none_t.cpp +++ b/factory/test/factory_with_none_t.cpp @@ -21,6 +21,12 @@ class sum operator int() const { return this->val_sum; } }; +// Suppress warnings about std::auto_ptr. +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + int main() { int one = 1, two = 2; @@ -44,3 +50,7 @@ int main() #endif return boost::report_errors(); } + +#if defined(__clang__) +#pragma clang diagnostic pop +#endif