aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cpptools/cppcompletion_test.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2015-04-06 23:10:51 +0300
committerOrgad Shaneh <orgads@gmail.com>2015-04-11 17:27:39 +0000
commit7ba2210102ce12ae845cccfa17624d59a1ba66bd (patch)
tree46bd148e955ef57a7290bf02ddd8916451936dd5 /src/plugins/cpptools/cppcompletion_test.cpp
parentc2a2c4c819849f28d0bafd607116998a9a669773 (diff)
CppTools: Add failing tests for recursive instantiation
Task-number: QTCREATORBUG-14237 Change-Id: I59ae931994ef6577010a4544219ba3b0cd85c677 Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Diffstat (limited to 'src/plugins/cpptools/cppcompletion_test.cpp')
-rw-r--r--src/plugins/cpptools/cppcompletion_test.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp
index e6cc006825..78757e6b15 100644
--- a/src/plugins/cpptools/cppcompletion_test.cpp
+++ b/src/plugins/cpptools/cppcompletion_test.cpp
@@ -324,6 +324,8 @@ void CppToolsPlugin::test_completion()
QEXPECT_FAIL("pointer_indirect_specialization_typedef", "QTCREATORBUG-14141", Abort);
QEXPECT_FAIL("pointer_indirect_specialization_double_indirection", "QTCREATORBUG-14141", Abort);
QEXPECT_FAIL("pointer_indirect_specialization_double_indirection_with_base", "QTCREATORBUG-14141", Abort);
+ QEXPECT_FAIL("recursive_instantiation_of_template_type", "QTCREATORBUG-14237", Abort);
+ QEXPECT_FAIL("recursive_instantiation_of_template_type_2", "QTCREATORBUG-14141", Abort);
QCOMPARE(actualCompletions, expectedCompletions);
}
@@ -2815,6 +2817,36 @@ void CppToolsPlugin::test_completion_data()
) << _("t.p->") << (QStringList()
<< QLatin1String("Foo")
<< QLatin1String("bar"));
+
+ QTest::newRow("recursive_instantiation_of_template_type") << _(
+ "template<typename _Tp>\n"
+ "struct Temp { typedef _Tp value_type; };\n"
+ "\n"
+ "struct Foo { int bar; };\n"
+ "\n"
+ "void func()\n"
+ "{\n"
+ " Temp<Temp<Foo> >::value_type::value_type *p;\n"
+ " @\n"
+ "}\n"
+ ) << _("p->") << (QStringList()
+ << QLatin1String("Foo")
+ << QLatin1String("bar"));
+
+ QTest::newRow("recursive_instantiation_of_template_type_2") << _(
+ "template<typename _Tp>\n"
+ "struct Temp { typedef _Tp value_type; };\n"
+ "\n"
+ "struct Foo { int bar; };\n"
+ "\n"
+ "void func()\n"
+ "{\n"
+ " Temp<Temp<Foo>::value_type>::value_type *p;\n"
+ " @\n"
+ "}\n"
+ ) << _("p->") << (QStringList()
+ << QLatin1String("Foo")
+ << QLatin1String("bar"));
}
void CppToolsPlugin::test_completion_member_access_operator()