diff options
author | Mitch Phillips <mitchphillips@outlook.com> | 2019-09-19 21:11:28 +0000 |
---|---|---|
committer | Mitch Phillips <mitchphillips@outlook.com> | 2019-09-19 21:11:28 +0000 |
commit | d5b8a7c61f35256c09c45a6ce9937c836617ea05 (patch) | |
tree | b10a774ecb2141b5a01464a8b3fb18eaff6610ef /lib/Sema/SemaOverload.cpp | |
parent | 0ec02e88b21bbc46a5c9c6e0be5e00315cf0a07b (diff) | |
download | clang-d5b8a7c61f35256c09c45a6ce9937c836617ea05.tar.gz |
Revert "[CUDA][HIP] Fix typo in `BestViableFunction`"
Broke the msan buildbots (see comments on rL372318 for more details).
This reverts commit eb231d15825ac345b546f4c99372d1cac8f14f02.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372353 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r-- | lib/Sema/SemaOverload.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index 3e07bd2181..9cf778f934 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -9422,19 +9422,17 @@ OverloadCandidateSet::BestViableFunction(Sema &S, SourceLocation Loc, const FunctionDecl *Caller = dyn_cast<FunctionDecl>(S.CurContext); bool ContainsSameSideCandidate = llvm::any_of(Candidates, [&](OverloadCandidate *Cand) { - // Consider viable function only. - return Cand->Viable && Cand->Function && + return Cand->Function && S.IdentifyCUDAPreference(Caller, Cand->Function) == Sema::CFP_SameSide; }); if (ContainsSameSideCandidate) { - // Clear viable flag for WrongSide varible candidates. - llvm::for_each(Candidates, [&](OverloadCandidate *Cand) { - if (Cand->Viable && Cand->Function && - S.IdentifyCUDAPreference(Caller, Cand->Function) == - Sema::CFP_WrongSide) - Cand->Viable = false; - }); + auto IsWrongSideCandidate = [&](OverloadCandidate *Cand) { + return Cand->Function && + S.IdentifyCUDAPreference(Caller, Cand->Function) == + Sema::CFP_WrongSide; + }; + llvm::erase_if(Candidates, IsWrongSideCandidate); } } |