зеркало из https://github.com/microsoft/clang-1.git
Fix <rdar://problem/6248764> parser rejects: bad receiver type 'CFStringRef'.
Downgrade an error to a warning (for GCC compatibility). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65779 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
ed8a93d17b
Коммит
8e2945ad91
|
@ -946,7 +946,7 @@ DIAG(error_no_super_class, ERROR,
|
|||
"no super class declared in @interface for %0")
|
||||
DIAG(err_invalid_receiver_to_message, ERROR,
|
||||
"invalid receiver to message expression")
|
||||
DIAG(error_bad_receiver_type, ERROR,
|
||||
DIAG(warn_bad_receiver_type, WARNING,
|
||||
"bad receiver type %0")
|
||||
DIAG(error_objc_throw_expects_object, ERROR,
|
||||
"invalid %0 argument (expected an ObjC object type)")
|
||||
|
|
|
@ -464,7 +464,7 @@ Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel,
|
|||
if (Method && DiagnoseUseOfDecl(Method, receiverLoc))
|
||||
return true;
|
||||
} else {
|
||||
Diag(lbrac, diag::error_bad_receiver_type)
|
||||
Diag(lbrac, diag::warn_bad_receiver_type)
|
||||
<< RExpr->getType() << RExpr->getSourceRange();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -5,5 +5,13 @@
|
|||
@end
|
||||
|
||||
void __raiseExc1() {
|
||||
[objc_lookUpClass("NSString") retain]; // expected-error {{ "bad receiver type 'int'" }}
|
||||
[objc_lookUpClass("NSString") retain]; // expected-warning {{ "bad receiver type 'int'" }}
|
||||
}
|
||||
|
||||
typedef const struct __CFString * CFStringRef;
|
||||
|
||||
void func() {
|
||||
CFStringRef obj;
|
||||
|
||||
[obj self]; // expected-warning {{bad receiver type 'CFStringRef' (aka 'struct __CFString const *')}}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ void f(id super) {
|
|||
[super m];
|
||||
}
|
||||
void f0(int super) {
|
||||
[super m]; // expected-error{{bad receiver type 'int'}}
|
||||
[super m]; // expected-warning{{bad receiver type 'int'}}
|
||||
}
|
||||
void f1(int puper) {
|
||||
[super m]; // expected-error{{use of undeclared identifier 'super'}}
|
||||
|
|
Загрузка…
Ссылка в новой задаче