зеркало из https://github.com/microsoft/clang-1.git
outside a method, 'super' should resolve in a normal name look up
to mimic gcc's behavior. Fixes radar 7400691. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94246 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
04bb716aea
Коммит
e4fb82839a
|
@ -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];
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче