Implement LWG 2148: Make non-enum default hash specialization well-formed

Summary:
This patch removes the static_assert for non-enum types in the primary hash template. Instead non-enum types create a hash<T> specialization that is not constructible nor callable.

See also:
  * http://cplusplus.github.io/LWG/lwg-active.html#2543
  * https://llvm.org/bugs/show_bug.cgi?id=28917

Reviewers: mclow.lists, EricWF

Subscribers: mehdi_amini, cfe-commits

Differential Revision: https://reviews.llvm.org/D23331

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278300 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2016-08-10 22:45:26 +00:00
parent 02e94f8095
commit 2d08bc9a9f
3 changed files with 54 additions and 9 deletions

View File

@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <functional>
// make sure that we can hash enumeration values
@@ -14,8 +16,6 @@
#include "test_macros.h"
#if TEST_STD_VER >= 14
#include <functional>
#include <cassert>
#include <type_traits>
@@ -59,6 +59,3 @@ int main()
test<Fruits>();
}
#else
int main () {}
#endif