[LLVMbugs] [Bug 7971] New: Overload resolution fails when taking the address of a function that is both a static and non-static member

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Aug 23 00:45:35 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=7971

           Summary: Overload resolution fails when taking the address of a
                    function that is both a static and non-static member
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: chandlerc at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


% cat t.cc
void f(bool (*)(int, char));

struct S {
  void g() {
    f(&g);
  }

  static bool g(int, char);
};

% ./bin/clang -fsyntax-only t.cc
t.cc:5:5: error: no matching function for call to 'f'
    f(&g);
    ^
t.cc:1:6: note: candidate function not viable: no known conversion from
'<overloaded function type> *' to 'bool (*)(int, char)' for 1st argument
void f(bool (*)(int, char));
     ^
1 error generated.

-- 
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.



More information about the llvm-bugs mailing list