public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/52309] New: [c++0x] unordered_set illegally requires value_type::operator!=
@ 2012-02-19 16:32 roman at binarylife dot net
2012-02-19 17:12 ` [Bug libstdc++/52309] " paolo.carlini at oracle dot com
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: roman at binarylife dot net @ 2012-02-19 16:32 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52309
Bug #: 52309
Summary: [c++0x] unordered_set illegally requires
value_type::operator!=
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: roman@binarylife.net
$ cat test.cpp
#include <unordered_set>
struct value {};
struct hash { std::size_t operator()(value const&)const; };
bool operator==(value const&,value const&);
std::unordered_set<value,hash> set;
bool z=(set==set);
$ g++ -std=c++0x -c test.cpp 2>&1 | egrep error
...../include/c++/4.7.0/bits/hashtable_policy.h:1116:4: error: no match for
‘operator!=’ in ‘__ity.std::__detail::_Node_const_iterator<_Value,
__constant_iterators, __cache>::operator*<value, true, true>() !=
__itx.std::__detail::_Node_const_iterator<_Value, __constant_iterators,
__cache>::operator*<value, true, true>()’
"set==set" needs operator!=(value,value).
The "value" type is EqualityComparable and looks good for unordered_set.
(17.6.3.1, 23.2.1, 23.2.5/2 and 23.2.5/11)
All other associative unordered containers do not need
value_type::operator!=(). Only unordered_set requires it.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libstdc++/52309] [c++0x] unordered_set illegally requires value_type::operator!=
2012-02-19 16:32 [Bug libstdc++/52309] New: [c++0x] unordered_set illegally requires value_type::operator!= roman at binarylife dot net
@ 2012-02-19 17:12 ` paolo.carlini at oracle dot com
2012-02-20 11:17 ` paolo at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-02-19 17:12 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52309
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2012-02-19
AssignedTo|unassigned at gcc dot |paolo.carlini at oracle dot
|gnu.org |com
Ever Confirmed|0 |1
--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-02-19 16:54:37 UTC ---
Oops, but seems trivial to fix.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libstdc++/52309] [c++0x] unordered_set illegally requires value_type::operator!=
2012-02-19 16:32 [Bug libstdc++/52309] New: [c++0x] unordered_set illegally requires value_type::operator!= roman at binarylife dot net
2012-02-19 17:12 ` [Bug libstdc++/52309] " paolo.carlini at oracle dot com
@ 2012-02-20 11:17 ` paolo at gcc dot gnu.org
2012-02-20 11:35 ` paolo at gcc dot gnu.org
2012-02-20 11:39 ` paolo.carlini at oracle dot com
3 siblings, 0 replies; 5+ messages in thread
From: paolo at gcc dot gnu.org @ 2012-02-20 11:17 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52309
--- Comment #2 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2012-02-20 11:11:44 UTC ---
Author: paolo
Date: Mon Feb 20 11:11:39 2012
New Revision: 184388
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184388
Log:
2012-02-20 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/52309
* include/bits/hashtable_policy.h (_Equality_base<, true,>::
_M_equal(const _Hashtable&)): Compare values with operator==.
* testsuite/23_containers/unordered_set/operators/52309.cc: New.
Added:
trunk/libstdc++-v3/testsuite/23_containers/unordered_set/operators/52309.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/bits/hashtable_policy.h
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libstdc++/52309] [c++0x] unordered_set illegally requires value_type::operator!=
2012-02-19 16:32 [Bug libstdc++/52309] New: [c++0x] unordered_set illegally requires value_type::operator!= roman at binarylife dot net
2012-02-19 17:12 ` [Bug libstdc++/52309] " paolo.carlini at oracle dot com
2012-02-20 11:17 ` paolo at gcc dot gnu.org
@ 2012-02-20 11:35 ` paolo at gcc dot gnu.org
2012-02-20 11:39 ` paolo.carlini at oracle dot com
3 siblings, 0 replies; 5+ messages in thread
From: paolo at gcc dot gnu.org @ 2012-02-20 11:35 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52309
--- Comment #3 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2012-02-20 11:31:07 UTC ---
Author: paolo
Date: Mon Feb 20 11:31:01 2012
New Revision: 184389
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184389
Log:
2012-02-20 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/52309
* include/bits/hashtable_policy.h (_Equality_base<, true,>::
_M_equal(const _Hashtable&)): Compare values with operator==.
* testsuite/23_containers/unordered_set/operators/52309.cc: New.
Added:
branches/gcc-4_6-branch/libstdc++-v3/testsuite/23_containers/unordered_set/operators/52309.cc
Modified:
branches/gcc-4_6-branch/libstdc++-v3/ChangeLog
branches/gcc-4_6-branch/libstdc++-v3/include/bits/hashtable_policy.h
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libstdc++/52309] [c++0x] unordered_set illegally requires value_type::operator!=
2012-02-19 16:32 [Bug libstdc++/52309] New: [c++0x] unordered_set illegally requires value_type::operator!= roman at binarylife dot net
` (2 preceding siblings ...)
2012-02-20 11:35 ` paolo at gcc dot gnu.org
@ 2012-02-20 11:39 ` paolo.carlini at oracle dot com
3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-02-20 11:39 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52309
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.6.3
--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-02-20 11:31:56 UTC ---
Fixed mainline and 4.6.3.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-02-20 11:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-19 16:32 [Bug libstdc++/52309] New: [c++0x] unordered_set illegally requires value_type::operator!= roman at binarylife dot net
2012-02-19 17:12 ` [Bug libstdc++/52309] " paolo.carlini at oracle dot com
2012-02-20 11:17 ` paolo at gcc dot gnu.org
2012-02-20 11:35 ` paolo at gcc dot gnu.org
2012-02-20 11:39 ` paolo.carlini at oracle dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).