DIAG(err_block_decl_ref_not_modifiable_lvalue, ERROR,
"variable is not assignable (missing __block type specifier)")
DIAG(err_typecheck_call_not_function, ERROR,
- "called object is not a function or function pointer")
+ "called object type '%0' is not a function or function pointer")
DIAG(err_typecheck_call_too_few_args, ERROR,
"too few arguments to function")
DIAG(err_typecheck_block_too_few_args, ERROR,
const PointerType *PT = Fn->getType()->getAsPointerType();
if (PT == 0)
return Diag(LParenLoc, diag::err_typecheck_call_not_function)
- << Fn->getSourceRange();
+ << Fn->getType().getAsString() << Fn->getSourceRange();
FuncT = PT->getPointeeType()->getAsFunctionType();
} else { // This is a block call.
FuncT = Fn->getType()->getAsBlockPointerType()->getPointeeType()->
}
if (FuncT == 0)
return Diag(LParenLoc, diag::err_typecheck_call_not_function)
- << Fn->getSourceRange();
+ << Fn->getType().getAsString() << Fn->getSourceRange();
// We know the result type of the call, set it.
TheCall->setType(FuncT->getResultType().getNonReferenceType());
(float*)X = P; // expected-error {{assignment to cast is illegal, lvalue casts are not supported}}
}
+void test6() {
+ int X;
+ X(); // expected-error {{called object type 'int' is not a function or function pointer}}
+}