forked from OSchip/llvm-project
outside a method, 'super' should resolve in a normal name look up
to mimic gcc's behavior. Fixes radar 7400691. llvm-svn: 94246
This commit is contained in:
parent
690818fc27
commit
935f041243
|
@ -398,7 +398,17 @@ Sema::ExprResult Sema::ActOnClassMessage(
|
|||
return ActOnInstanceMessage(ReceiverExpr.get(), Sel, lbrac,
|
||||
selectorLoc, rbrac, Args, NumArgs);
|
||||
}
|
||||
return Diag(receiverLoc, diag::err_undeclared_var_use) << receiverName;
|
||||
else if (TypedefDecl *OCTD = dyn_cast_or_null<TypedefDecl>(SuperDecl)) {
|
||||
const ObjCInterfaceType *OCIT;
|
||||
OCIT = OCTD->getUnderlyingType()->getAs<ObjCInterfaceType>();
|
||||
if (!OCIT) {
|
||||
Diag(receiverLoc, diag::err_invalid_receiver_to_message);
|
||||
return true;
|
||||
}
|
||||
ClassDecl = OCIT->getDecl();
|
||||
}
|
||||
else
|
||||
return Diag(receiverLoc, diag::err_undeclared_var_use) << receiverName;
|
||||
}
|
||||
} else
|
||||
ClassDecl = getObjCInterfaceDecl(receiverName, receiverLoc);
|
||||
|
|
|
@ -39,3 +39,10 @@ void f0(int super) {
|
|||
void f1(int puper) {
|
||||
[super m]; // expected-error{{use of undeclared identifier 'super'}}
|
||||
}
|
||||
|
||||
// radar 7400691
|
||||
typedef Foo super;
|
||||
|
||||
void test() {
|
||||
[super cMethod];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue