diff options
author | Chris Lattner <sabre@nondot.org> | 2010-08-27 22:32:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-08-27 22:32:41 +0000 |
commit | 1ba644575d3ce979d6218ca2f6765b4227b0ce14 (patch) | |
tree | cb897c717da2113c6fa83504d325d9950421231b /clang/lib | |
parent | e5aa30c722a7e5ffec1372c2a863a54bfd558850 (diff) | |
download | bcm5719-llvm-1ba644575d3ce979d6218ca2f6765b4227b0ce14.tar.gz bcm5719-llvm-1ba644575d3ce979d6218ca2f6765b4227b0ce14.zip |
handle :: in selectors in objc++ mode, rdar://8366474
llvm-svn: 112307
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Parse/ParseObjc.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/Parse/ParseObjc.cpp b/clang/lib/Parse/ParseObjc.cpp index 914d52ea38d..c36f09c881a 100644 --- a/clang/lib/Parse/ParseObjc.cpp +++ b/clang/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; |