http://llvm.org/bugs/show_bug.cgi?id=16781
Bug ID: 16781
Summary: Bad Diagnostic: conversion from overloaded function
doesn't provide enough context
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Keywords: googler
Severity: normal
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected]
Classification: Unclassified
$ cat str.cpp
void func(void (*)(bool));
void f(const int&);
void f(int);
int main() {
func(f);
}
$ clang++-tot str.cpp -fsyntax-only
str.cpp:6:3: error: no matching function for call to 'func'
func(f);
^~~~
str.cpp:1:6: note: candidate function not viable: no overload of 'f' matching
'void (*)(bool)' for 1st argument
void func(void (*)(bool));
^
1 error generated.
Not mentioning the overloads in the overload set of 'f' makes this hard to
track down if the overloads are distant from the callsite. In the original case
this bug came from there was another function with the same name but the right
arguments elsewhere (it was a member of a class, in this instance - but could
be in another namespace, etc).
(CC Kaelyn in case she wants to tackle this with typo correction (add a
"namespace (or class) foo { void f(bool); }" to the example above and suggest
that as a solution to this error) - though we'll probably still want to fix the
underlying issue anyway)
--
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