Skip to content

C++20 reversed operator== not properly suppressed by operator!= in namespace #68901

Closed
llvm/llvm-project-release-prs
#778
@jyknight

Description

@jyknight
namespace N {
  struct A {};
  bool operator==(A, int);
  bool operator!=(A, int);
}
bool a = 0 == N::A();

This should fail to compile, because the existence of operator!= should suppress the reversed operator==(int, A). However, on Clang it does not.

Moving bool a within the namespace does make it correctly fail to compile, which suggests that name lookup for the operator!= is not being done in the correct scope.

@usx95

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions