forked from OSchip/llvm-project
parent
e5433a90ce
commit
cc9c5452d1
|
@ -258,8 +258,10 @@ Sema::ExprResult Sema::ActOnInstanceMessage(
|
|||
SourceRange(lbrac, rbrac));
|
||||
}
|
||||
else {
|
||||
assert(ObjCInterfaceType::classof(receiverType.getTypePtr()) &&
|
||||
"bad receiver type");
|
||||
if (!isa<ObjCInterfaceType>(receiverType.getTypePtr())) {
|
||||
Diag(lbrac, diag::error_bad_receiver_type, receiverType.getAsString());
|
||||
return true;
|
||||
}
|
||||
ClassDecl = static_cast<ObjCInterfaceType*>(
|
||||
receiverType.getTypePtr())->getDecl();
|
||||
// FIXME: consider using InstanceMethodPool, since it will be faster
|
||||
|
|
|
@ -482,6 +482,8 @@ DIAG(err_toomany_element_decls, ERROR,
|
|||
"Only one element declaration is allowed")
|
||||
DIAG(warn_expected_implementation, WARNING,
|
||||
"@end must appear in an @implementation context")
|
||||
DIAG(error_bad_receiver_type, ERROR,
|
||||
"bad receiver type (its type is '%0')")
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Semantic Analysis
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
@interface I
|
||||
- (id) retain;
|
||||
@end
|
||||
|
||||
void __raiseExc1() {
|
||||
[objc_lookUpClass("NSString") retain]; // expected-error {{ "bad receiver type (its type is 'int')" }}
|
||||
}
|
Loading…
Reference in New Issue