C++: Fix resolving of templated partial specialization

Use-case:
template<class T> struct t {};

template<class> struct s { float f; };
template<class X> struct s<t<X>> { int i; };

void f()
{
    s<t<char>> var;
    var.i; // i not highlighted
}

Task-number: QTCREATORBUG-14034
Change-Id: I5d00bc3247352fca4af4c41a47c208ec3e193c8e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2015-05-31 20:07:49 +03:00
committed by Orgad Shaneh
parent 2070431d8c
commit ec4d242bb3
2 changed files with 22 additions and 0 deletions

View File

@@ -2637,6 +2637,21 @@ void CppToolsPlugin::test_completion_data()
<< QLatin1String("i")
<< QLatin1String("s"));
QTest::newRow("partial_specialization_templated_argument") << _(
"template<class T> struct t {};\n"
"\n"
"template<class> struct s { float f; };\n"
"template<class X> struct s<t<X>> { int i; };\n"
"\n"
"void f()\n"
"{\n"
" s<t<char>> var;\n"
" @\n"
"}\n"
) << _("var.") << (QStringList()
<< QLatin1String("i")
<< QLatin1String("s"));
QTest::newRow("auto_declaration_in_if_condition") << _(
"struct Foo { int bar; };\n"
"void fun() {\n"