Fix an assertion when code-completing, rdar://9288730 & http://llvm.org/PR9728.

llvm-svn: 130042
This commit is contained in:
Argyrios Kyrtzidis 2011-04-23 01:04:12 +00:00
parent 9ae982053f
commit 7d94c9277a
2 changed files with 15 additions and 1 deletions

View File

@ -161,7 +161,12 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS,
// Code completion for a nested-name-specifier, where the code
// code completion token follows the '::'.
Actions.CodeCompleteQualifiedId(getCurScope(), SS, EnteringContext);
ConsumeCodeCompletionToken();
SourceLocation ccLoc = ConsumeCodeCompletionToken();
// Include code completion token into the range of the scope otherwise
// when we try to annotate the scope tokens the dangling code completion
// token will cause assertion in
// Preprocessor::AnnotatePreviousCachedTokens.
SS.setEndLoc(ccLoc);
}
}

View File

@ -0,0 +1,9 @@
namespace N {
struct SFoo;
}
struct brokenfile_t {
brokenfile_t (N::
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:6:20 %s -o - | FileCheck %s
// CHECK: SFoo