Bug 60970

Summary: Support std::hash with enum types (LWG 2148)
Product: gcc Reporter: Geoff Romer <gromer>
Component: libstdc++Assignee: Ville Voutilainen <ville.voutilainen>
Status: RESOLVED FIXED    
Severity: normal CC: alexandre.nunes, daniel.kruegler, ppluzhnikov, ville.voutilainen, webrown.cpp
Priority: P3    
Version: unknown   
Target Milestone: 6.0   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2014-04-26 00:00:00

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