Thanks for your feedback !

I've applied all your recommendations and it works nicely. Here is the test case:

// { dg-do compile }

#include <vector>
#if __cplusplus >= 201103L
#include <tuple>
#endif

struct NoOperators
{
};

struct Struct
{
  operator std::vector<int>() const;
} s;

int main()
{
  using namespace std;

  bool res __attribute__((unused));
  res = s == s; // { dg-error "no match" }

  NoOperators s1, s2;
  res = s1 == s2; // { dg-error "no match" }
  res = s1 < s2; // { dg-error "no match" }
  res = s1 != s2; // { dg-error "no match" }
  res = s1 > s2; // { dg-error "no match" }
  res = s1 <= s2; // { dg-error "no match" }
  res = s1 >= s2; // { dg-error "no match" }
}

// { dg-bogus "candidate" "" { target *-*-* } 0 }

As you can see I've added the test case you provided to show why all this is not Standard conformant.

My problem is that if you try to build it without the dg-bogus last line, and without my patch, it PASS !

So currently the compiler is not considering the std::vector() cast operator to find a == operator on Struct s. If I cast it compiles, regardless of std::vector operator == being friend inlined or not.

It doesn't seem to have noticeable effect in this case, does it ?


Reply via email to