aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cpptools/cppcompletion_test.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2015-03-31 22:57:57 +0300
committerOrgad Shaneh <orgads@gmail.com>2015-04-01 09:45:24 +0000
commit0501efdcd9549236b3cfa4a99a45b33515a486e9 (patch)
tree1c5450baf9239662fd81c962c2c4a737e00eae97 /src/plugins/cpptools/cppcompletion_test.cpp
parent55ed8b861b42a69d4da597e5cb45c1bb0d62278a (diff)
CppTools: Add a failing test for explicit template base typedef
Task-number: QTCREATORBUG-14218 Change-Id: I1cccc522f0d484e966f97bea86236e83caec754a 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.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp
index a754622134..e6cc006825 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 <class T> struct Base { typedef T F; };\n"
+ "template <class T> struct Derived : Base<T> { F f; };\n"
+ "\n"
+ "void func() {\n"
+ " Derived<Data> d;\n"
+ " @\n"
+ "}\n"
+ ) << _("d.f.") << QStringList();
+
+ QTest::newRow("template_as_base: explicit typedef from base") << _(
+ "class Data { int dataMember; };\n"
+ "template <class T> struct Base { typedef T F; };\n"
+ "template <class T> struct Derived : Base<T>\n"
+ "{\n"
+ " typedef typename Base<T>::F F;\n"
+ " F f;\n"
+ "};\n"
+ "\n"
+ "void func() {\n"
+ " Derived<Data> 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"