aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseObjc.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-08-27 22:32:41 +0000
committerChris Lattner <sabre@nondot.org>2010-08-27 22:32:41 +0000
commit5add7541726348b9d1c8e96ac5031b87c41acff0 (patch)
treefb7f1f7db8e29b0aed5d20840b60945a94d4016f /lib/Parse/ParseObjc.cpp
parentec49bf464c91a52b3a463940da6589d03bf40248 (diff)
handle :: in selectors in objc++ mode, rdar://8366474
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112307 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseObjc.cpp')
-rw-r--r--lib/Parse/ParseObjc.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp
index 914d52ea38..c36f09c881 100644
--- a/lib/Parse/ParseObjc.cpp
+++ b/lib/Parse/ParseObjc.cpp
@@ -2204,17 +2204,21 @@ ExprResult Parser::ParseObjCSelectorExpression(SourceLocation AtLoc) {
}
IdentifierInfo *SelIdent = ParseObjCSelectorPiece(sLoc);
- if (!SelIdent && Tok.isNot(tok::colon)) // missing selector name.
+ if (!SelIdent && // missing selector name.
+ Tok.isNot(tok::colon) && Tok.isNot(tok::coloncolon))
return ExprError(Diag(Tok, diag::err_expected_ident));
KeyIdents.push_back(SelIdent);
unsigned nColons = 0;
if (Tok.isNot(tok::r_paren)) {
while (1) {
- if (Tok.isNot(tok::colon))
+ if (Tok.is(tok::coloncolon)) { // Handle :: in C++.
+ ++nColons;
+ KeyIdents.push_back(0);
+ } else if (Tok.isNot(tok::colon))
return ExprError(Diag(Tok, diag::err_expected_colon));
- nColons++;
+ ++nColons;
ConsumeToken(); // Eat the ':'.
if (Tok.is(tok::r_paren))
break;