aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-11-19 17:10:50 +0000
committerDouglas Gregor <dgregor@apple.com>2010-11-19 17:10:50 +0000
commit46f936e055d763437accd1e5a1bc49e7e5dbc0a3 (patch)
treecea13a1f8b7a47ec6d3b2c27c8ce2b2f43d2abab /lib/Parse/ParseDecl.cpp
parentd02bba8e2abceebd91c162ee4479623791f455b5 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119805 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r--lib/Parse/ParseDecl.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index ed58a92323..121289696d 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/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.