aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-09-22 17:29:51 +0000
committerAnders Carlsson <andersca@mac.com>2009-09-22 17:29:51 +0000
commit90756300f3c8beea14b7ae0c229405981e2870c2 (patch)
tree0f853aa1ff99b3ca4b8fc823aba2d37d9e59233a /lib/Sema/SemaCodeComplete.cpp
parent5cc58c6cfe4a6378287dbf92f9b1a23e133a6118 (diff)
(With Doug's help) fix a crash in the code completion code that lead to a test failure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82558 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCodeComplete.cpp')
-rw-r--r--lib/Sema/SemaCodeComplete.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp
index 757bb62711..cfec7b2374 100644
--- a/lib/Sema/SemaCodeComplete.cpp
+++ b/lib/Sema/SemaCodeComplete.cpp
@@ -1132,6 +1132,8 @@ void Sema::CodeCompleteCall(Scope *S, ExprTy *FnIn,
// Add the remaining viable overload candidates as code-completion reslults.
typedef CodeCompleteConsumer::Result Result;
ResultBuilder Results(*this);
+ Results.EnterNewScope();
+
for (OverloadCandidateSet::iterator Cand = CandidateSet.begin(),
CandEnd = CandidateSet.end();
Cand != CandEnd; ++Cand) {
@@ -1139,6 +1141,7 @@ void Sema::CodeCompleteCall(Scope *S, ExprTy *FnIn,
Results.MaybeAddResult(Result(Cand->Function, 0), 0);
}
+ Results.ExitScope();
HandleCodeCompleteResults(CodeCompleter, Results.data(), Results.size());
}