This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53499] New: Incorrect partial ordering result with member vs non-member
- From: "schaub.johannes at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 27 May 2012 13:58:06 +0000
- Subject: [Bug c++/53499] New: Incorrect partial ordering result with member vs non-member
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53499
Bug #: 53499
Summary: Incorrect partial ordering result with member vs
non-member
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: schaub.johannes@googlemail.com
I think that this is ambiguous for partial ordering ambiguities, but GCC
accepts this code, selecting the non-member
template <class P>
class ptr
{
public:
// Picked in C++11 mode.
template<class T>
void operator- (T) const
{ static_assert(sizeof(T) == 0, "#1"); }
};
// Picked in default C++ mode.
template<class T1, class T2>
void operator- (const ptr<T1>&, const ptr<T2>&)
{ static_assert(sizeof(T1) == 0, "#2"); }
int
main ()
{
ptr <int> a, b;
(void) (b - a);
}