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: unassig...@gcc.gnu.org
        ReportedBy: schaub.johan...@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);
}

Reply via email to