forked from OSchip/llvm-project
Don't ICE (issue diagnostics) when receiver is a non-objc
type. llvm-svn: 62355
This commit is contained in:
parent
6bfc77d8fe
commit
10401ce2e0
|
@ -239,8 +239,9 @@ Sema::ExprResult Sema::ActOnClassMessage(
|
|||
if (TypedefDecl *OCTD = dyn_cast_or_null<TypedefDecl>(IDecl)) {
|
||||
const ObjCInterfaceType *OCIT;
|
||||
OCIT = OCTD->getUnderlyingType()->getAsObjCInterfaceType();
|
||||
if (OCIT)
|
||||
ClassDecl = OCIT->getDecl();
|
||||
if (!OCIT)
|
||||
return Diag(receiverLoc, diag::err_invalid_receiver_to_message);
|
||||
ClassDecl = OCIT->getDecl();
|
||||
}
|
||||
}
|
||||
assert(ClassDecl && "missing interface declaration");
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
typedef struct NotAClass {
|
||||
int a, b;
|
||||
} NotAClass;
|
||||
|
||||
void foo() {
|
||||
[NotAClass nonexistent_method]; // expected-error {{invalid receiver to message expression}}
|
||||
}
|
Loading…
Reference in New Issue