forked from OSchip/llvm-project
parent
e5433a90ce
commit
cc9c5452d1
|
@ -258,8 +258,10 @@ Sema::ExprResult Sema::ActOnInstanceMessage(
|
||||||
SourceRange(lbrac, rbrac));
|
SourceRange(lbrac, rbrac));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
assert(ObjCInterfaceType::classof(receiverType.getTypePtr()) &&
|
if (!isa<ObjCInterfaceType>(receiverType.getTypePtr())) {
|
||||||
"bad receiver type");
|
Diag(lbrac, diag::error_bad_receiver_type, receiverType.getAsString());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
ClassDecl = static_cast<ObjCInterfaceType*>(
|
ClassDecl = static_cast<ObjCInterfaceType*>(
|
||||||
receiverType.getTypePtr())->getDecl();
|
receiverType.getTypePtr())->getDecl();
|
||||||
// FIXME: consider using InstanceMethodPool, since it will be faster
|
// 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")
|
"Only one element declaration is allowed")
|
||||||
DIAG(warn_expected_implementation, WARNING,
|
DIAG(warn_expected_implementation, WARNING,
|
||||||
"@end must appear in an @implementation context")
|
"@end must appear in an @implementation context")
|
||||||
|
DIAG(error_bad_receiver_type, ERROR,
|
||||||
|
"bad receiver type (its type is '%0')")
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Semantic Analysis
|
// 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