Don't show deleted function (constructor) candidates for code completion
In case of copy constructor is implicitly deleted it's still shown.
PR34402 describes a way to reproduce that.
Patch by Ivan Donchevskii!
Differential Revision: https://reviews.llvm.org/D37435
llvm-svn: 312785
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index 4de7d42..7001849 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -4286,9 +4286,12 @@
});
// Add the remaining viable overload candidates as code-completion results.
- for (auto &Candidate : CandidateSet)
+ for (auto &Candidate : CandidateSet) {
+ if (Candidate.Function && Candidate.Function->isDeleted())
+ continue;
if (Candidate.Viable)
Results.push_back(ResultCandidate(Candidate.Function));
+ }
}
}