Allow function calls to dereferenced member pointers of

pointer-to-function type. Fixes <rdar://problem/9065289>.

llvm-svn: 127739
This commit is contained in:
Douglas Gregor 2011-03-16 17:42:23 +00:00
parent a0ff0c34a7
commit 6341ceedc5
2 changed files with 15 additions and 3 deletions

View File

@ -4574,9 +4574,6 @@ Sema::ActOnCallExpr(Scope *S, Expr *Fn, SourceLocation LParenLoc,
return MaybeBindToTemporary(TheCall);
}
return ExprError(Diag(Fn->getLocStart(),
diag::err_typecheck_call_not_function)
<< Fn->getType() << Fn->getSourceRange());
}
}
}

View File

@ -34,3 +34,18 @@ void test0() {
Test0 mytest;
mytest.test();
}
namespace rdar9065289 {
typedef void (*FuncPtr)();
struct X0 { };
struct X1
{
X0* x0;
FuncPtr X0::*fptr;
};
void f(X1 p) {
(p.x0->*(p.fptr))();
}
}