r270872 - in /trunk/libstdc++-v3: ChangeLog inc...
redi@gcc.gnu.org
redi@gcc.gnu.org
Sat May 4 14:35:00 GMT 2019
Author: redi
Date: Sat May 4 14:35:25 2019
New Revision: 270872
URL: https://gcc.gnu.org/viewcvs?rev=270872&root=gcc&view=rev
Log:
Fix std::hash<std::error_condition>
The hash value should be based on the identity (i.e. address) of the
error_category member, not its object representation (i.e. underlying
bytes).
* include/std/system_error (error_code): Remove friend declaration
for hash<error_code>.
(hash<error_code>::operator()): Use public member functions to access
value and category.
(hash<error_condition>::operator()): Use address of category, not
its object representation.
* src/c++11/compatibility-c++0x.cc (hash<error_code>::operator()):
Use public member functions to access value and category.
* testsuite/19_diagnostics/error_condition/hash.cc: New test.
Added:
trunk/libstdc++-v3/testsuite/19_diagnostics/error_condition/hash.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/std/system_error
trunk/libstdc++-v3/src/c++11/compatibility-c++0x.cc
More information about the Libstdc++-cvs
mailing list