diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2015-05-31 19:57:26 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2015-06-04 19:23:40 +0000 |
commit | 2070431d8ca867acfb4391c275cd82caff4d711a (patch) | |
tree | 154c7489a0eacc8f8db4c16e1ba443708185cd5d /src/plugins/cpptools/cppcompletion_test.cpp | |
parent | d8c012e29b017159993510fff9c0710f5ac4d1b4 (diff) |
C++: Fix resolving of partial specialization
Use-case:
struct b {};
template<class X, class Y> struct s { float f; };
template<class X> struct s<X, b> { int i; };
void f()
{
s<int, b> var;
var.i; // i not highlighted
}
Task-number: QTCREATORBUG-14036
Change-Id: I70a87499e0a375e84d992ca0a79d77270a3419e8
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 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp index cc98254c76..82a58d4760 100644 --- a/src/plugins/cpptools/cppcompletion_test.cpp +++ b/src/plugins/cpptools/cppcompletion_test.cpp @@ -2623,6 +2623,20 @@ void CppToolsPlugin::test_completion_data() ) << _("s.") << (QStringList() << QLatin1String("S")); + QTest::newRow("partial_specialization") << _( + "struct b {};\n" + "template<class X, class Y> struct s { float f; };\n" + "template<class X> struct s<X, b> { int i; };\n" + "\n" + "void f()\n" + "{\n" + " s<int, b> 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" |