From e7ceb85b0dcf9b04eedbbf849f98a489cd7dfb8b Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Tue, 22 Sep 2009 17:29:51 +0000 Subject: (With Doug's help) fix a crash in the code completion code that lead to a test failure. llvm-svn: 82558 --- clang/lib/Sema/SemaCodeComplete.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib') diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index 757bb62711d..cfec7b23749 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/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()); } -- cgit v1.2.3