From f2df43055f95f7c487e75708fac755b955a61056 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 31840193..a29d895a 100644 --- a/src/messages/textDocument_completion.cc +++ b/src/messages/textDocument_completion.cc @@ -392,8 +392,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;