From 0501efdcd9549236b3cfa4a99a45b33515a486e9 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 31 Mar 2015 22:57:57 +0300 Subject: [PATCH] CppTools: Add a failing test for explicit template base typedef Task-number: QTCREATORBUG-14218 Change-Id: I1cccc522f0d484e966f97bea86236e83caec754a Reviewed-by: Nikolai Kosjar --- src/plugins/cpptools/cppcompletion_test.cpp | 29 +++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp index a754622134b..e6cc0068250 100644 --- a/src/plugins/cpptools/cppcompletion_test.cpp +++ b/src/plugins/cpptools/cppcompletion_test.cpp @@ -314,6 +314,7 @@ void CppToolsPlugin::test_completion() actualCompletions.sort(); expectedCompletions.sort(); + QEXPECT_FAIL("template_as_base: explicit typedef from base", "QTCREATORBUG-14218", Abort); QEXPECT_FAIL("enum_in_function_in_struct_in_function", "QTCREATORBUG-13757", Abort); QEXPECT_FAIL("enum_in_function_in_struct_in_function_cxx11", "QTCREATORBUG-13757", Abort); QEXPECT_FAIL("enum_in_function_in_struct_in_function_anon", "QTCREATORBUG-13757", Abort); @@ -710,6 +711,34 @@ void CppToolsPlugin::test_completion_data() << QLatin1String("Other") << QLatin1String("otherMember")); + QTest::newRow("template_as_base: typedef not available in derived") << _( + "class Data { int dataMember; };\n" + "template struct Base { typedef T F; };\n" + "template struct Derived : Base { F f; };\n" + "\n" + "void func() {\n" + " Derived d;\n" + " @\n" + "}\n" + ) << _("d.f.") << QStringList(); + + QTest::newRow("template_as_base: explicit typedef from base") << _( + "class Data { int dataMember; };\n" + "template struct Base { typedef T F; };\n" + "template struct Derived : Base\n" + "{\n" + " typedef typename Base::F F;\n" + " F f;\n" + "};\n" + "\n" + "void func() {\n" + " Derived d;\n" + " @\n" + "}\n" + ) << _("d.f.") << (QStringList() + << QLatin1String("Data") + << QLatin1String("dataMember")); + QTest::newRow("use_global_identifier_as_base_class: derived as global and base as global") << _( "struct Global\n" "{\n"