diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-11-19 17:10:50 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-11-19 17:10:50 +0000 |
commit | 3a001f48e4492d7f4a8e0607a3ea3d206827bc33 (patch) | |
tree | cce35805cc0f4f1cae651cf8e0d6e4cad2189d5b /clang/lib/Parse/ParseDecl.cpp | |
parent | 2e49eaa92f7e33469dd5913c243e7cf5e27db70b (diff) | |
download | bcm5719-llvm-3a001f48e4492d7f4a8e0607a3ea3d206827bc33.tar.gz bcm5719-llvm-3a001f48e4492d7f4a8e0607a3ea3d206827bc33.zip |
When parsing something that looks like an ill-formed
protocol-qualifier list without a leading type (e.g., <#blah#>), don't
complain about it being an archaic protocol-qualifier list unless it
actually parses as one.
llvm-svn: 119805
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index ed58a92323d..121289696db 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -1434,11 +1434,10 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, if (DS.hasTypeSpecifier() || !getLang().ObjC1) goto DoneWithDeclSpec; - ParseObjCProtocolQualifiers(DS); - - Diag(Loc, diag::warn_objc_protocol_qualifier_missing_id) - << FixItHint::CreateInsertion(Loc, "id") - << SourceRange(Loc, DS.getSourceRange().getEnd()); + if (!ParseObjCProtocolQualifiers(DS)) + Diag(Loc, diag::warn_objc_protocol_qualifier_missing_id) + << FixItHint::CreateInsertion(Loc, "id") + << SourceRange(Loc, DS.getSourceRange().getEnd()); // Need to support trailing type qualifiers (e.g. "id<p> const"). // If a type specifier follows, it will be diagnosed elsewhere. |