Issue 92188
Summary clang++-19: rejects-valid
Labels
Assignees
Reporter egorpugin
    https://godbolt.org/z/E5xqebhfK

```
struct A {
    template <auto N>
    void operator+=(this auto &&obj, const char (&c)[N]) {
    }
    void operator+=(this auto &&obj, auto &&c) {
    }
};

int main() {
    A a;
    a += "123";
}
```

```
<source>:11:7: error: use of overloaded operator '+=' is ambiguous (with operand types 'A' and 'const char[4]')
 11 |     a += "123";
      |     ~ ^  ~~~~~
<source>:3:10: note: candidate function [with N = 4UL, obj:auto = A &]
    3 |     void operator+=(this auto &&obj, const char (&c)[N]) {
      | ^
<source>:5:10: note: candidate function [with obj:auto = A &, c:auto = const char (&)[4]]
    5 |     void operator+=(this auto &&obj, auto &&c) {
      |          ^
1 error generated.
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to