From 7ba2210102ce12ae845cccfa17624d59a1ba66bd Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 6 Apr 2015 23:10:51 +0300 Subject: [PATCH] CppTools: Add failing tests for recursive instantiation Task-number: QTCREATORBUG-14237 Change-Id: I59ae931994ef6577010a4544219ba3b0cd85c677 Reviewed-by: Przemyslaw Gorszkowski --- src/plugins/cpptools/cppcompletion_test.cpp | 32 +++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp index e6cc0068250..78757e6b15e 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\n" + "struct Temp { typedef _Tp value_type; };\n" + "\n" + "struct Foo { int bar; };\n" + "\n" + "void func()\n" + "{\n" + " Temp >::value_type::value_type *p;\n" + " @\n" + "}\n" + ) << _("p->") << (QStringList() + << QLatin1String("Foo") + << QLatin1String("bar")); + + QTest::newRow("recursive_instantiation_of_template_type_2") << _( + "template\n" + "struct Temp { typedef _Tp value_type; };\n" + "\n" + "struct Foo { int bar; };\n" + "\n" + "void func()\n" + "{\n" + " Temp::value_type>::value_type *p;\n" + " @\n" + "}\n" + ) << _("p->") << (QStringList() + << QLatin1String("Foo") + << QLatin1String("bar")); } void CppToolsPlugin::test_completion_member_access_operator()