summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseCXXInlineMethods.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-03-27 23:58:17 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-03-27 23:58:17 +0000
commitc36633c47ac478465e133cfa9155cccc3c84b8ab (patch)
tree54957cf90e50ad415557616aee5f16812c6058cf /clang/lib/Parse/ParseCXXInlineMethods.cpp
parentdeec07403cb88b6e72b8a25fff5e6f4b8d0705dd (diff)
downloadbcm5719-llvm-c36633c47ac478465e133cfa9155cccc3c84b8ab.tar.gz
bcm5719-llvm-c36633c47ac478465e133cfa9155cccc3c84b8ab.zip
[Parser] Don't code-complete twice.
When we are consuming the current token just to enter a new token stream, we push the current token in the back of the stream so that we get it again. Unfortunately this had the effect where if the current token is a code-completion one, we would code-complete once during consuming it and another time after the stream ended. Fix this by making sure that, in this case, ConsumeAnyToken() will consume a code-completion token without invoking code-completion. rdar://12842503 llvm-svn: 178199
Diffstat (limited to 'clang/lib/Parse/ParseCXXInlineMethods.cpp')
-rw-r--r--clang/lib/Parse/ParseCXXInlineMethods.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseCXXInlineMethods.cpp b/clang/lib/Parse/ParseCXXInlineMethods.cpp
index 30aee20b267..bc634b57d9c 100644
--- a/clang/lib/Parse/ParseCXXInlineMethods.cpp
+++ b/clang/lib/Parse/ParseCXXInlineMethods.cpp
@@ -407,7 +407,7 @@ void Parser::ParseLexedMethodDef(LexedMethod &LM) {
PP.EnterTokenStream(LM.Toks.data(), LM.Toks.size(), true, false);
// Consume the previously pushed token.
- ConsumeAnyToken();
+ ConsumeAnyToken(/*ConsumeCodeCompletionTok=*/true);
assert((Tok.is(tok::l_brace) || Tok.is(tok::colon) || Tok.is(tok::kw_try))
&& "Inline method not starting with '{', ':' or 'try'");
@@ -510,7 +510,7 @@ void Parser::ParseLexedMemberInitializer(LateParsedMemberInitializer &MI) {
PP.EnterTokenStream(MI.Toks.data(), MI.Toks.size(), true, false);
// Consume the previously pushed token.
- ConsumeAnyToken();
+ ConsumeAnyToken(/*ConsumeCodeCompletionTok=*/true);
SourceLocation EqualLoc;
OpenPOWER on IntegriCloud