http://llvm.org/bugs/show_bug.cgi?id=8750
Summary: Incorrect OR of conversion function templates against
non-template conversion functions
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Clang accepts the following code
void f(int);
void f(long);
struct A {
template<typename T> operator T();
operator long();
};
int main() {
f(A());
}
However it's supposed to reject it: For the first f, you end up using the
"operator T<int>" (since int -> int is better than long -> int), and for the
second f, you end up using the non-template operator long (since it's a
non-template, it's preferred over the function template specialization).
The two user defined conversion sequences created aren't comparable because
they don't use the same conversion function. So the call is ambiguous.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs