forked from OSchip/llvm-project
parent
0c9404e0a7
commit
cd8d572283
|
@ -1402,4 +1402,6 @@ DIAG(warn_objc_array_of_interfaces, WARNING,
|
|||
"array of interface %0 should probably be an array of pointers")
|
||||
DIAG(ext_c99_array_usage, EXTENSION,
|
||||
"use of C99-specific array features, accepted as an extension")
|
||||
DIAG(warn_ignoring_objc_qualifiers, WARNING,
|
||||
"ignoring protocol qualifiers on non-ObjC type")
|
||||
|
||||
|
|
|
@ -151,6 +151,9 @@ QualType Sema::ConvertDeclSpecToType(const DeclSpec &DS) {
|
|||
// id<protocol-list>
|
||||
Result = Context.getObjCQualifiedIdType((ObjCProtocolDecl**)PQ,
|
||||
DS.getNumProtocolQualifiers());
|
||||
else
|
||||
Diag(DS.getSourceRange().getBegin(),
|
||||
diag::warn_ignoring_objc_qualifiers) << DS.getSourceRange();
|
||||
}
|
||||
// TypeQuals handled by caller.
|
||||
break;
|
||||
|
|
|
@ -21,4 +21,9 @@ void foo(id x) {
|
|||
|
||||
// FIXME: provide a better diagnostic (no typedef).
|
||||
- (void)m2:(id <MyProtocol> short)arg1; // expected-error {{'short type-name' is invalid}}
|
||||
@end
|
||||
@end
|
||||
|
||||
typedef int NotAnObjCObjectType;
|
||||
|
||||
// GCC doesn't diagnose this.
|
||||
NotAnObjCObjectType <SomeProtocol> *obj; // expected-warning {{ignoring protocol qualifiers on non-ObjC type}}
|
||||
|
|
Loading…
Reference in New Issue