Commit 17162ec7 authored by Rolf Eike Beer's avatar Rolf Eike Beer Committed by Milian Wolff
Browse files

do not offer explicitely deleted methods for code completion

BUG:306771

Again basically done by Milian.
parent 9c95600d
......@@ -2152,6 +2152,10 @@ bool CodeCompletionContext::filterDeclaration(Declaration* decl, DUContext* dec
if(!decl)
return true;
if (decl->isExplicitlyDeleted()) {
return false;
}
if(dynamic_cast<TemplateParameterDeclaration*>(decl) && !visibleFromWithin(decl, m_duContext.data()))
return false;
......
......@@ -359,7 +359,11 @@ void TestCppCodeCompletion::testInvalidContexts()
void TestCppCodeCompletion::testMemberAccess()
{
QByteArray method = "template<class T1, class T2> class T { public: T1 ta(); class U { public: class V{ }; }; }; class X { public: X(){}; int a(int a, T<int,int> b); int b;}; T<int,int> t; X* getX() { }";
QByteArray method = "template<class T1, class T2> class T { public: T1 ta(); class U { public: class V{ }; }; };"
"class X { public: X(){}; int a(int a, T<int,int> b); int b;};"
"T<int,int> t;"
"X* getX() { }"
"class Z { public: Z() = delete; static int a(int b); };";
TopDUContext* top = parse(method, DumpNone);
int ctxt = 4;
DUChainWriteLocker lock(DUChain::lock());
......@@ -381,6 +385,9 @@ void TestCppCodeCompletion::testMemberAccess()
CompletionItemTester testColons2(top->childContexts()[ctxt], "T::U::");
QCOMPARE(testColons2.names, QStringList() << "V");
QCOMPARE(testColons2.completionContext->accessType(), Cpp::CodeCompletionContext::StaticMemberChoose);
CompletionItemTester testDeleted(top->childContexts()[ctxt], "Z::");
QCOMPARE(testDeleted.names, QStringList() << "a");
QCOMPARE(testDeleted.completionContext->accessType(), Cpp::CodeCompletionContext::StaticMemberChoose);
release(top);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment