forked from OSchip/llvm-project
Allow function calls to dereferenced member pointers of
pointer-to-function type. Fixes <rdar://problem/9065289>. llvm-svn: 127739
This commit is contained in:
parent
a0ff0c34a7
commit
6341ceedc5
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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))();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue