completion: ignore CXXDeductionGuide

Fix #173
This commit is contained in:
Fangrui Song 2018-12-22 23:52:24 -08:00
parent f8c8eca8ee
commit 61ff7aacc6

View File

@ -380,8 +380,15 @@ public:
R.Availability == CXAvailability_NotAvailable) R.Availability == CXAvailability_NotAvailable)
continue; continue;
if (R.Declaration) { if (R.Declaration) {
if (R.Declaration->getKind() == Decl::CXXDestructor) Decl::Kind K = R.Declaration->getKind();
if (K == Decl::CXXDestructor)
continue; continue;
if (K == Decl::FunctionTemplate) {
// Ignore CXXDeductionGuide which has empty TypedText.
auto *FD = cast<FunctionTemplateDecl>(R.Declaration);
if (FD->getTemplatedDecl()->getKind() == Decl::CXXDeductionGuide)
continue;
}
if (auto *RD = dyn_cast<RecordDecl>(R.Declaration)) if (auto *RD = dyn_cast<RecordDecl>(R.Declaration))
if (RD->isInjectedClassName()) if (RD->isInjectedClassName())
continue; continue;