[LLVMbugs] [Bug 6911] New: Function pointer with template cannot be passed as argument

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 23 15:21:20 PDT 2010


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

           Summary: Function pointer with template cannot be passed as
                    argument
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: evan at chromium.org
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=4727)
 --> (http://llvm.org/bugs/attachment.cgi?id=4727)
reduction of problem

Clang r102190.

$ clang++ reduce.cc
clang: Instructions.cpp:247: void llvm::CallInst::init(llvm::Value*,
llvm::Value* const*, unsigned int): Assertion `(i >= FTy->getNumParams() ||
FTy->getParamType(i) == Params[i]->getType()) && "Calling a function with a bad
signature!"' failed.

Code below, also attached.  This came up in compiling WebKit with v8.


template <class T> class Foo;

// Callback type that involves template.
typedef void (*Callback)(Foo<int> arg);
// Function that is an instance of that type.
static void f(Foo<int> arg);
// Function that takes a callback as an argument.
void g(Callback callback);

// Pass one to the other -- boom.
void h() {
  g(&f);
}

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