Bug 60970 - Support std::hash with enum types (LWG 2148)
Summary: Support std::hash with enum types (LWG 2148)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: 6.0
Assignee: Ville Voutilainen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-25 23:28 UTC by Geoff Romer
Modified: 2017-03-14 13:14 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2014-04-26 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Geoff Romer 2014-04-25 23:28:41 UTC
std::hash<T> appears to be undefined when T is an enum type, contrary to the resolution of LWG 2148 (http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2148).
Comment 1 Paul Pluzhnikov 2014-05-13 17:48:16 UTC
Google ref: b/8985947
Comment 2 Ville Voutilainen 2015-07-21 22:41:58 UTC
Mine.
Comment 3 Ville Voutilainen 2015-07-25 19:24:45 UTC
Patch available: https://gcc.gnu.org/ml/gcc-patches/2015-07/msg02162.html
Comment 4 Jonathan Wakely 2015-07-29 12:41:55 UTC
Author: redi
Date: Wed Jul 29 12:41:23 2015
New Revision: 226347

URL: https://gcc.gnu.org/viewcvs?rev=226347&root=gcc&view=rev
Log:
2015-07-29  Ville Voutilainen  <ville.voutilainen@gmail.com>

	PR libstdc++/60970
	* include/bits/functional_hash.h (__hash_enum): New.
	(hash): Derive from __hash_enum.
	* testsuite/20_util/hash/60970.cc: New.

Added:
    trunk/libstdc++-v3/testsuite/20_util/hash/60970.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/functional_hash.h
Comment 5 Jonathan Wakely 2017-03-14 13:14:03 UTC
Fixed for 6.1