From 3b413e60833b6150fa7e610352e83c5df2647cc0 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 12 Mar 2021 19:15:18 +0000 Subject: [PATCH 1/4] Update boost_has_hash.ipp tests for multiset. --- test/boost_has_hash.ipp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/boost_has_hash.ipp b/test/boost_has_hash.ipp index 45ac40fa..b893c416 100644 --- a/test/boost_has_hash.ipp +++ b/test/boost_has_hash.ipp @@ -26,6 +26,11 @@ void foo(const BOOST_STD_EXTENSION_NAMESPACE::hash_set& ) { } +template +void foo(const BOOST_STD_EXTENSION_NAMESPACE::hash_multiset& ) +{ +} + template void foo(const BOOST_STD_EXTENSION_NAMESPACE::hash_map& ) { @@ -37,9 +42,15 @@ int test() { #ifndef DISABLE_BOOST_HAS_HASH_TEST BOOST_STD_EXTENSION_NAMESPACE::hash_set hs; + hs.insert(2); foo(hs); BOOST_STD_EXTENSION_NAMESPACE::hash_map hm; + hm[3] = 2; foo(hm); + BOOST_STD_EXTENSION_NAMESPACE::hash_multiset hs2; + hs2.insert(2); + hs2.insert(2); + foo(hs2); #endif return 0; } From 9a06b9a4877091c3392a67d134ec4cea0896f838 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 12 Mar 2021 19:27:19 +0000 Subject: [PATCH 2/4] hash_set/hash_map no longer function from gcc-10 onwards. --- include/boost/config/stdlib/libstdcpp3.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/boost/config/stdlib/libstdcpp3.hpp b/include/boost/config/stdlib/libstdcpp3.hpp index f01ff5f9..688ee198 100644 --- a/include/boost/config/stdlib/libstdcpp3.hpp +++ b/include/boost/config/stdlib/libstdcpp3.hpp @@ -167,6 +167,15 @@ # define BOOST_LIBSTDCXX_VERSION 40300 #endif +#if (BOOST_LIBSTDCXX_VERSION >= 100000) && defined(BOOST_HAS_HASH) +// +// hash_set/hash_map deprecated and have terminal bugs: +// +#undef BOOST_HAS_HAS +#undef BOOST_HAS_SET_HEADER +#undef BOOST_HAS_MAP_HEADER +#endif + #if (BOOST_LIBSTDCXX_VERSION < 50100) // libstdc++ does not define this function as it's deprecated in C++11, but clang still looks for it, // defining it here is a terrible cludge, but should get things working: From 5e71c0dcade3d124883901e37aeadd3f4ac171d4 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 12 Mar 2021 19:33:04 +0000 Subject: [PATCH 3/4] Correct spelling of BOOST_HAS_HASH in undef! --- include/boost/config/stdlib/libstdcpp3.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/config/stdlib/libstdcpp3.hpp b/include/boost/config/stdlib/libstdcpp3.hpp index 688ee198..6b628952 100644 --- a/include/boost/config/stdlib/libstdcpp3.hpp +++ b/include/boost/config/stdlib/libstdcpp3.hpp @@ -97,7 +97,7 @@ #if defined(__has_include) #if defined(BOOST_HAS_HASH) #if !__has_include(BOOST_HASH_SET_HEADER) -#undef BOOST_HAS_HAS +#undef BOOST_HAS_HASH #undef BOOST_HAS_SET_HEADER #undef BOOST_HAS_MAP_HEADER #endif @@ -171,7 +171,7 @@ // // hash_set/hash_map deprecated and have terminal bugs: // -#undef BOOST_HAS_HAS +#undef BOOST_HAS_HASH #undef BOOST_HAS_SET_HEADER #undef BOOST_HAS_MAP_HEADER #endif From 499c0f965ee037248a903cef64b79d90a8d05550 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 12 Mar 2021 19:46:48 +0000 Subject: [PATCH 4/4] Correct gcc-10 boost_has_hash. --- include/boost/config/stdlib/libstdcpp3.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/config/stdlib/libstdcpp3.hpp b/include/boost/config/stdlib/libstdcpp3.hpp index 6b628952..e63a0975 100644 --- a/include/boost/config/stdlib/libstdcpp3.hpp +++ b/include/boost/config/stdlib/libstdcpp3.hpp @@ -96,7 +96,7 @@ #if defined(__has_include) #if defined(BOOST_HAS_HASH) -#if !__has_include(BOOST_HASH_SET_HEADER) +#if !__has_include(BOOST_HASH_SET_HEADER) || (__GNUC__ >= 10) #undef BOOST_HAS_HASH #undef BOOST_HAS_SET_HEADER #undef BOOST_HAS_MAP_HEADER @@ -176,6 +176,7 @@ #undef BOOST_HAS_MAP_HEADER #endif + #if (BOOST_LIBSTDCXX_VERSION < 50100) // libstdc++ does not define this function as it's deprecated in C++11, but clang still looks for it, // defining it here is a terrible cludge, but should get things working: