diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2015-05-31 20:07:49 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2015-06-04 19:23:50 +0000 |
commit | ec4d242bb3ed17eff793f591ff8184f378380ef0 (patch) | |
tree | e8aca878f4ee10554338c05091cd6b020f72aa79 /src/plugins/cpptools/cppcompletion_test.cpp | |
parent | 2070431d8ca867acfb4391c275cd82caff4d711a (diff) | |
download | qt-creator-ec4d242bb3ed17eff793f591ff8184f378380ef0.tar.gz |
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>
Diffstat (limited to 'src/plugins/cpptools/cppcompletion_test.cpp')
-rw-r--r-- | src/plugins/cpptools/cppcompletion_test.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp index 82a58d4760..d8bd4101e2 100644 --- a/src/plugins/cpptools/cppcompletion_test.cpp +++ b/src/plugins/cpptools/cppcompletion_test.cpp @@ -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" |