diff options
| author | Eric Fiselier <eric@efcs.ca> | 2017-03-03 22:35:58 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2017-03-03 22:35:58 +0000 |
| commit | bd6a2d850565341ff6fbf134998d48ad84d35585 (patch) | |
| tree | 4fcbcf60038f02d81f5381fc166bfe1cb1fbf35f /libcxx/include/__hash_table | |
| parent | 7ee83b41e01e3377b6c96a418eea2bd8b8b5b940 (diff) | |
| download | bcm5719-llvm-bd6a2d850565341ff6fbf134998d48ad84d35585.tar.gz bcm5719-llvm-bd6a2d850565341ff6fbf134998d48ad84d35585.zip | |
Fix hash requirements check in __hash_table.
r296565 attempted to add better diagnostics when an unordered container
is instantiated with a hash that doesn't meet the Hash requirements.
However I mistakenly checked the wrong set of requirements. Specifically
it checked if the hash met the requirements for specializations of
std::hash. However these requirements are stricter than the generic
Hash requirements.
This patch fixes the assertions to only check the Hash requirements.
llvm-svn: 296919
Diffstat (limited to 'libcxx/include/__hash_table')
| -rw-r--r-- | libcxx/include/__hash_table | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table index 9d9a2905532..216149371b7 100644 --- a/libcxx/include/__hash_table +++ b/libcxx/include/__hash_table @@ -871,16 +871,15 @@ public: template <class _Key, class _Hash, class _Equal, class _Alloc> struct __diagnose_hash_table_helper { static constexpr bool __trigger_diagnostics() - _LIBCPP_DIAGNOSE_WARNING(__has_enabled_hash<_Key, _Hash>::value + _LIBCPP_DIAGNOSE_WARNING(__check_hash_requirements<_Key, _Hash>::value && !__invokable<_Hash const&, _Key const&>::value, "the specified hash functor does not provide a const call operator") _LIBCPP_DIAGNOSE_WARNING(is_copy_constructible<_Equal>::value && !__invokable<_Equal const&, _Key const&, _Key const&>::value, "the specified comparator type does not provide a const call operator") { - static_assert(__has_enabled_hash<_Key, _Hash>::value, - "the specified hash functor does not meet the requirements for an " - "enabled hash"); + static_assert(__check_hash_requirements<_Key, _Hash>::value, + "the specified hash does not meet the Hash requirements"); static_assert(is_copy_constructible<_Equal>::value, "the specified comparator is required to be copy constructible"); return true; |

