JF Bastien
fd71b93500
is_integral_or_enum ❥ enum class ⇒ hashable enum class
...
Summary:
As discussed in D18775 making AtomicOrdering an enum class makes it non-hashable, which shouldn't be the case. Hashing.h defines hash_value for all is_integral_or_enum, but type_traits.h's definition of is_integral_or_enum only checks for *inplicit* conversion to integral types which leaves enum classes out and is very confusing because is_enum is true for enum classes.
This patch:
- Adds a check for is_enum when determining is_integral_or_enum.
- Explicitly converts the value parameter in hash_value to handle enum class hashing.
Note that the warning at the top of Hashing.h still applies: each execution of the program has a high probability of producing a different hash_code for a given input. Thus their values are not stable to save or persist, and should only be used during the execution for the construction of hashing datastructures.
Reviewers: dberlin, chandlerc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D18938
llvm-svn: 265879
2016-04-09 20:04:34 +00:00
..
2016-03-20 09:45:08 +00:00
2016-01-26 18:48:36 +00:00
2016-01-11 21:28:03 +00:00
2016-01-25 11:26:11 +00:00
2015-06-23 09:49:53 +00:00
2016-03-21 17:29:01 +00:00
2015-06-23 09:49:53 +00:00
2015-06-23 09:49:53 +00:00
2015-06-23 09:49:53 +00:00
2015-10-12 18:34:00 +00:00
2016-02-15 04:30:37 +00:00
2016-04-02 03:28:26 +00:00
2011-11-04 18:30:30 +00:00
2015-06-23 09:49:53 +00:00
2015-12-18 01:46:52 +00:00
2015-08-10 04:22:36 +00:00
2016-02-13 22:58:43 +00:00
2016-02-13 22:58:43 +00:00
2016-01-29 00:49:42 +00:00
2015-06-23 09:49:53 +00:00
2015-11-17 19:00:52 +00:00
2016-03-10 05:15:03 +00:00
2015-03-23 18:07:13 +00:00
2016-03-11 15:59:32 +00:00
2016-03-25 20:30:10 +00:00
2015-03-23 18:07:13 +00:00
2015-06-23 09:49:53 +00:00
2016-03-28 17:40:08 +00:00
2015-10-15 18:17:44 +00:00
2015-10-27 23:09:03 +00:00
2016-02-01 10:39:24 +00:00
2015-12-15 21:50:27 +00:00
2015-06-23 09:49:53 +00:00
2016-03-11 20:20:25 +00:00
2016-01-13 19:32:35 +00:00
2016-01-22 19:58:18 +00:00
2015-06-23 09:49:53 +00:00
2013-01-10 00:45:19 +00:00
2016-04-05 19:57:03 +00:00
2015-08-10 04:22:36 +00:00
2016-02-09 04:47:58 +00:00
2015-08-13 00:31:39 +00:00
2016-04-01 00:18:08 +00:00
2015-06-23 09:49:53 +00:00
2016-02-08 01:02:55 +00:00
2015-06-23 09:49:53 +00:00
2015-10-14 00:04:19 +00:00
2016-01-07 19:21:29 +00:00
2015-08-10 04:22:36 +00:00
2015-10-27 23:09:03 +00:00
2016-02-26 17:01:45 +00:00
2015-09-01 21:23:58 +00:00
2014-09-17 18:23:07 +00:00
2010-11-29 18:16:10 +00:00
2015-06-23 09:49:53 +00:00
2013-01-10 00:45:19 +00:00
2015-02-15 22:54:22 +00:00
2015-10-28 22:36:05 +00:00
2016-02-25 22:05:19 +00:00
2016-01-18 21:01:50 +00:00
2016-02-09 13:28:44 +00:00
2015-10-31 00:55:32 +00:00
2015-12-18 01:46:52 +00:00
2015-06-23 09:49:53 +00:00
2015-06-23 09:49:53 +00:00
2015-06-23 09:49:53 +00:00
2015-06-23 09:49:53 +00:00
2016-03-26 01:49:50 +00:00
2015-08-08 18:27:36 +00:00
2015-11-09 18:56:31 +00:00
2015-06-23 09:49:53 +00:00
2015-12-30 23:37:25 +00:00
2015-08-07 17:47:03 +00:00
2015-12-04 01:31:59 +00:00
2015-06-23 09:49:53 +00:00
2016-02-03 21:45:39 +00:00
2015-06-23 09:49:53 +00:00
2015-06-23 09:49:53 +00:00
2015-12-16 22:59:06 +00:00
2016-04-01 05:12:18 +00:00
2015-10-07 20:49:09 +00:00
2015-06-23 09:49:53 +00:00
2015-06-23 09:49:53 +00:00
2016-02-09 19:37:25 +00:00
2015-06-23 09:49:53 +00:00
2014-04-10 09:44:32 +00:00
2016-02-02 18:20:45 +00:00
2016-04-01 04:30:16 +00:00
2015-07-22 21:11:17 +00:00
2015-08-10 04:22:09 +00:00
2013-05-21 20:36:13 +00:00
2015-06-23 09:49:53 +00:00
2015-02-15 22:54:22 +00:00
2016-03-27 23:00:59 +00:00
2015-06-23 09:49:53 +00:00
2015-08-13 01:07:02 +00:00
2015-05-19 08:44:15 +00:00
2015-06-23 09:49:53 +00:00
2015-12-01 10:33:56 +00:00
2015-12-21 22:09:27 +00:00
2015-08-10 04:22:09 +00:00
2016-03-04 00:25:54 +00:00
2015-08-10 04:22:09 +00:00
2015-06-23 09:49:53 +00:00
2016-03-24 20:39:17 +00:00
2015-12-22 17:36:17 +00:00
2015-06-23 09:49:53 +00:00
2015-06-23 09:49:53 +00:00
2016-02-09 02:09:16 +00:00
2016-04-09 20:04:34 +00:00
2016-02-25 06:13:01 +00:00
2014-05-13 10:11:29 +00:00
2015-10-24 22:15:32 +00:00
2015-06-23 09:49:53 +00:00
2016-03-28 17:40:08 +00:00
2015-06-23 09:49:53 +00:00
2014-09-11 21:46:33 +00:00
2014-08-13 16:26:38 +00:00
2016-01-06 05:17:12 +00:00
2016-03-17 00:34:54 +00:00