diff --git a/include/boost/config/stdlib/libstdcpp3.hpp b/include/boost/config/stdlib/libstdcpp3.hpp index f01ff5f9..e63a0975 100644 --- a/include/boost/config/stdlib/libstdcpp3.hpp +++ b/include/boost/config/stdlib/libstdcpp3.hpp @@ -96,8 +96,8 @@ #if defined(__has_include) #if defined(BOOST_HAS_HASH) -#if !__has_include(BOOST_HASH_SET_HEADER) -#undef BOOST_HAS_HAS +#if !__has_include(BOOST_HASH_SET_HEADER) || (__GNUC__ >= 10) +#undef BOOST_HAS_HASH #undef BOOST_HAS_SET_HEADER #undef BOOST_HAS_MAP_HEADER #endif @@ -167,6 +167,16 @@ # 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_HASH +#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: 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; }