[Parser] Don't code-complete twice.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 27 Mar 2013 23:58:17 +0000 (23:58 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 27 Mar 2013 23:58:17 +0000 (23:58 +0000)
commitc36633c47ac478465e133cfa9155cccc3c84b8ab
tree54957cf90e50ad415557616aee5f16812c6058cf
parentdeec07403cb88b6e72b8a25fff5e6f4b8d0705dd
[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
clang/include/clang/Parse/Parser.h
clang/lib/Parse/ParseCXXInlineMethods.cpp
clang/lib/Parse/ParseDecl.cpp
clang/lib/Parse/ParseObjc.cpp
clang/lib/Parse/ParseTemplate.cpp
clang/test/Index/complete-declarators.m