From 45ac75fce3b6aa6a687ed261d0c4b25b620ab17d Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sat, 22 Dec 2018 23:52:24 -0800 Subject: [PATCH] completion: ignore CXXDeductionGuide Fix #173 --- src/messages/textDocument_completion.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/messages/textDocument_completion.cc b/src/messages/textDocument_completion.cc index 49132467..7a95be03 100644 --- a/src/messages/textDocument_completion.cc +++ b/src/messages/textDocument_completion.cc @@ -380,8 +380,15 @@ public: R.Availability == CXAvailability_NotAvailable) continue; if (R.Declaration) { - if (R.Declaration->getKind() == Decl::CXXDestructor) + Decl::Kind K = R.Declaration->getKind(); + if (K == Decl::CXXDestructor) continue; + if (K == Decl::FunctionTemplate) { + // Ignore CXXDeductionGuide which has empty TypedText. + auto *FD = cast(R.Declaration); + if (FD->getTemplatedDecl()->getKind() == Decl::CXXDeductionGuide) + continue; + } if (auto *RD = dyn_cast(R.Declaration)) if (RD->isInjectedClassName()) continue;