[LLVMbugs] [Bug 16781] New: Bad Diagnostic: conversion from overloaded function doesn't provide enough context

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Aug 2 13:55:36 PDT 2013


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: unassignedclangbugs at nondot.org
          Reporter: dblaikie at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu,
                    rikka at google.com
    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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130802/877245e4/attachment.html>


More information about the llvm-bugs mailing list