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 | 46f936e055d763437accd1e5a1bc49e7e5dbc0a3 (patch) | |
tree | cea13a1f8b7a47ec6d3b2c27c8ce2b2f43d2abab /lib/Parse/ParseObjc.cpp | |
parent | d02bba8e2abceebd91c162ee4479623791f455b5 (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/ParseObjc.cpp')
-rw-r--r-- | lib/Parse/ParseObjc.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index c01bea9cb5..456c9c7282 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/lib/Parse/ParseObjc.cpp @@ -1038,18 +1038,19 @@ ParseObjCProtocolReferences(llvm::SmallVectorImpl<Decl *> &Protocols, /// \brief Parse the Objective-C protocol qualifiers that follow a typename /// in a decl-specifier-seq, starting at the '<'. -void Parser::ParseObjCProtocolQualifiers(DeclSpec &DS) { +bool Parser::ParseObjCProtocolQualifiers(DeclSpec &DS) { assert(Tok.is(tok::less) && "Protocol qualifiers start with '<'"); assert(getLang().ObjC1 && "Protocol qualifiers only exist in Objective-C"); SourceLocation LAngleLoc, EndProtoLoc; llvm::SmallVector<Decl *, 8> ProtocolDecl; llvm::SmallVector<SourceLocation, 8> ProtocolLocs; - ParseObjCProtocolReferences(ProtocolDecl, ProtocolLocs, false, - LAngleLoc, EndProtoLoc); + bool Result = ParseObjCProtocolReferences(ProtocolDecl, ProtocolLocs, false, + LAngleLoc, EndProtoLoc); DS.setProtocolQualifiers(ProtocolDecl.data(), ProtocolDecl.size(), ProtocolLocs.data(), LAngleLoc); if (EndProtoLoc.isValid()) DS.SetRangeEnd(EndProtoLoc); + return Result; } |