summaryrefslogtreecommitdiff
path: root/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2014-03-01 14:48:57 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2014-03-01 14:48:57 +0000
commit802ac72495558ab109f0ce407383ef3547d4ca59 (patch)
tree9efacbc8b40e26410c630b6980071598275405aa /lib/Sema/SemaCodeComplete.cpp
parentedea9113ff3b36fe7939ab054e0db9ed9a3b9c3b (diff)
downloadclang-802ac72495558ab109f0ce407383ef3547d4ca59.tar.gz
clang-802ac72495558ab109f0ce407383ef3547d4ca59.tar.bz2
clang-802ac72495558ab109f0ce407383ef3547d4ca59.tar.xz
[C++11] Replace verbose functors with succinct lambdas
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202590 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCodeComplete.cpp')
-rw-r--r--lib/Sema/SemaCodeComplete.cpp25
1 files changed, 6 insertions, 19 deletions
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp
index 5369a4beb2..28f85d7a9f 100644
--- a/lib/Sema/SemaCodeComplete.cpp
+++ b/lib/Sema/SemaCodeComplete.cpp
@@ -3825,22 +3825,6 @@ void Sema::CodeCompleteCase(Scope *S) {
Results.data(),Results.size());
}
-namespace {
- struct IsBetterOverloadCandidate {
- Sema &S;
- SourceLocation Loc;
-
- public:
- explicit IsBetterOverloadCandidate(Sema &S, SourceLocation Loc)
- : S(S), Loc(Loc) { }
-
- bool
- operator()(const OverloadCandidate &X, const OverloadCandidate &Y) const {
- return isBetterOverloadCandidate(S, X, Y, Loc);
- }
- };
-}
-
static bool anyNullArguments(ArrayRef<Expr *> Args) {
if (Args.size() && !Args.data())
return true;
@@ -3902,9 +3886,12 @@ void Sema::CodeCompleteCall(Scope *S, Expr *FnIn, ArrayRef<Expr *> Args) {
if (!CandidateSet.empty()) {
// Sort the overload candidate set by placing the best overloads first.
- std::stable_sort(CandidateSet.begin(), CandidateSet.end(),
- IsBetterOverloadCandidate(*this, Loc));
-
+ std::stable_sort(
+ CandidateSet.begin(), CandidateSet.end(),
+ [&](const OverloadCandidate &X, const OverloadCandidate &Y) {
+ return isBetterOverloadCandidate(*this, X, Y, Loc);
+ });
+
// Add the remaining viable overload candidates as code-completion reslults.
for (OverloadCandidateSet::iterator Cand = CandidateSet.begin(),
CandEnd = CandidateSet.end();