Issue 132600
Summary [clang] user-defined conversions failed.
Labels clang
Assignees
Reporter changkhothuychung
    Given this program 

```cpp
struct Alloc{}; 

struct MyString
{
 MyString();
    MyString(MyString&&, const Alloc&); 
 MyString(MyString&&); 
    MyString(const MyString&, const Alloc&); 
 MyString(const MyString&); 
};

struct A
{
    operator const MyString() const; 
};

int main() {
    MyString s(A{}, Alloc{}); 
    return 0;
}
```

Clang reports error `no viable conversion from 'A' to 'MyString'`, but gcc doesn't complain about it. The issue goes away when I change `operator const` to `operator`. Is this a bug in clang? If yes, I would like to work on this issue. 

link to compiler explorer: https://godbolt.org/z/xKfs8GoPr
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to