Commit 588b3336 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

CppTools: Highlight type for templated using



Task-number: QTCREATORBUG-9944
Change-Id: I614571e05039f24b7d56abdddc15f912581f68f1
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent d004b1b6
......@@ -1183,8 +1183,9 @@ bool CheckSymbols::isTemplateClass(Symbol *symbol) const
if (symbol) {
if (Template *templ = symbol->asTemplate()) {
if (Symbol *declaration = templ->declaration()) {
if (declaration->isClass() || declaration->isForwardClassDeclaration())
return true;
return declaration->isClass()
|| declaration->isForwardClassDeclaration()
|| declaration->isTypedef();
}
}
}
......
......@@ -994,6 +994,14 @@ void tst_CheckSymbols::test_checksymbols_data()
<< Use(10, 13, 3, Highlighting::LocalUse)
);
QTest::newRow("template_alias")
<< _("template<class T>\n"
"using Foo = Bar;\n")
<< (QList<Use>()
<< Use(1, 16, 1, Highlighting::TypeUse)
<< Use(2, 7, 3, Highlighting::TypeUse)
);
QTest::newRow("using_inside_different_namespace_QTCREATORBUG7978")
<< _("class My" TEST_UNICODE_IDENTIFIER "Type { int " TEST_UNICODE_IDENTIFIER "Member; };\n"
"void f(My" TEST_UNICODE_IDENTIFIER "Type var" TEST_UNICODE_IDENTIFIER ")\n"
......
Markdown is supported
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