llvm-project
llvm-project copied to clipboard
Error when taking address of overloaded conversion function, with only one non-template overload
https://godbolt.org/z/E899Y1qrq MSVC accepts this
struct S {
operator int();
template<typename T> operator T();
};
void f() {
&S::operator int;
}
<source>:8:2: error: reference to overloaded function could not be resolved; did you mean to call it?
8 | &S::operator int;
| ^~~~~~~~~~~~~~~~
1 error generated.
@llvm/issue-subscribers-clang-frontend
Author: Eczbek
https://godbolt.org/z/E899Y1qrq
MSVC accepts this
struct S {
operator int();
template<typename T> operator T();
};
void f() {
&S::operator int;
}
<source>:8:2: error: reference to overloaded function could not be resolved; did you mean to call it?
8 | &S::operator int;
| ^~~~~~~~~~~~~~~~
1 error generated.
Not just MSVC, GCC accepts this too.