Index: lib/Sema/SemaCodeComplete.cpp =================================================================== --- lib/Sema/SemaCodeComplete.cpp +++ 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)); + } } } Index: test/Index/complete-constructor-params.cpp =================================================================== --- test/Index/complete-constructor-params.cpp +++ test/Index/complete-constructor-params.cpp @@ -18,6 +18,20 @@ int(42); } +struct Foo { + Foo() = default; + Foo(const Foo&) = delete; +}; + +struct Bar { + Foo f; +}; + +void function() { + Bar b1; + Bar b2(b1); +} + // RUN: c-index-test -code-completion-at=%s:11:10 %s | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: OverloadCandidate:{Text S}{LeftParen (}{CurrentParameter const S &}{RightParen )} (1) // CHECK-CC1: OverloadCandidate:{Text S}{LeftParen (}{CurrentParameter int}{Comma , }{Placeholder U}{Comma , }{Placeholder U}{RightParen )} (1) @@ -138,3 +152,6 @@ // CHECK-CC10-NEXT: Class name // CHECK-CC10-NEXT: Nested name specifier // CHECK-CC10-NEXT: Objective-C interface + +// RUN: c-index-test -code-completion-at=%s:32:12 %s | FileCheck -check-prefix=CHECK-CC11 %s +// CHECK-CC11-NOT: OverloadCandidate:{Text Bar}{LeftParen (}{CurrentParameter const Bar &}{RightParen )} (1)