зеркало из https://github.com/microsoft/clang.git
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56433 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
5950b3f93a
Коммит
4f9b9f1e68
|
@ -445,9 +445,9 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS) {
|
|||
|
||||
DS.SetRangeEnd(EndProtoLoc);
|
||||
|
||||
// Do not allow any other declspecs after the protocol qualifier list
|
||||
// "<foo,bar>short" is not allowed.
|
||||
goto DoneWithDeclSpec;
|
||||
// Need to support trailing type qualifiers (e.g. "id<p> const").
|
||||
// If a type specifier follows, it will be diagnosed elsewhere.
|
||||
continue;
|
||||
}
|
||||
// GNU attributes support.
|
||||
case tok::kw___attribute:
|
||||
|
@ -585,9 +585,9 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS) {
|
|||
|
||||
Diag(Loc, diag::warn_objc_protocol_qualifier_missing_id,
|
||||
SourceRange(Loc, EndProtoLoc));
|
||||
// Do not allow any other declspecs after the protocol qualifier list
|
||||
// "<foo,bar>short" is not allowed.
|
||||
goto DoneWithDeclSpec;
|
||||
// Need to support trailing type qualifiers (e.g. "id<p> const").
|
||||
// If a type specifier follows, it will be diagnosed elsewhere.
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// If the specifier combination wasn't legal, issue a diagnostic.
|
||||
|
|
|
@ -12,3 +12,13 @@ void foo(id x) {
|
|||
[(<SomeProtocol>)x bar]; // expected-warning {{protocol qualifiers without 'id' is archaic}}
|
||||
}
|
||||
|
||||
@protocol MyProtocol
|
||||
- (void)doSomething;
|
||||
@end
|
||||
|
||||
@interface MyClass
|
||||
- (void)m1:(id <MyProtocol> const)arg1;
|
||||
|
||||
// FIXME: provide a better diagnostic (no typedef).
|
||||
- (void)m2:(id <MyProtocol> short)arg1; // expected-error {{'short typedef' is invalid}}
|
||||
@end
|
Загрузка…
Ссылка в новой задаче