sberg added a comment.

I just ran into newly-failing

  $ cat test.cc
  struct S1 {
      bool operator==(int);
      bool operator!=(int);
  };
  struct S2;
  bool operator ==(S2, S2);
  bool f(S1 s) { return 0 == s; }

  $ clang++ -std=c++20 -fsyntax-only test.cc
  test.cc:7:25: error: invalid operands to binary expression ('int' and 'S1')
  bool f(S1 s) { return 0 == s; }
                        ~ ^  ~
  test.cc:6:6: note: candidate function not viable: no known conversion from 
'int' to 'S2' for 1st argument
  bool operator ==(S2, S2);
       ^
  1 error generated.

It looks to me like this is correctly rejected now per P2468R2.  But it is 
rather confusing that a note mentions the `S2` candidate, while the relevant 
`S1` operators `==` and `!=` are not mentioned at all.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134529/new/

https://reviews.llvm.org/D134529

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to