aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cpptools/cppcompletion_test.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2015-03-24 23:24:06 +0200
committerOrgad Shaneh <orgads@gmail.com>2015-03-25 13:35:46 +0000
commitcdf12d63c040f315eb4df3e81bfa2a05783ef9e0 (patch)
tree668374435fce4a66fe508e3b96cbf56643747551 /src/plugins/cpptools/cppcompletion_test.cpp
parent20ad8e01c24a5821d4b42e8bc62636a83bf8fffa (diff)
CppTools: Add another failing test for indirect pointer specialization
Task-number: QTCREATORBUG-14141 Change-Id: I5f2187da15091027b2e71228b7cba048514c1005 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.cpp34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp
index 81e6d8b049..e7671c1325 100644
--- a/src/plugins/cpptools/cppcompletion_test.cpp
+++ b/src/plugins/cpptools/cppcompletion_test.cpp
@@ -319,7 +319,8 @@ void CppToolsPlugin::test_completion()
QEXPECT_FAIL("enum_in_function_in_struct_in_function_anon", "QTCREATORBUG-13757", Abort);
QEXPECT_FAIL("enum_in_class_accessed_in_member_func_cxx11", "QTCREATORBUG-13757", Abort);
QEXPECT_FAIL("enum_in_class_accessed_in_member_func_inline_cxx11", "QTCREATORBUG-13757", Abort);
- QEXPECT_FAIL("pointer_partial_specialization", "QTCREATORBUG-14141", Abort);
+ QEXPECT_FAIL("pointer_indirect_specialization", "QTCREATORBUG-14141", Abort);
+ QEXPECT_FAIL("pointer_indirect_specialization_typedef", "QTCREATORBUG-14141", Abort);
QCOMPARE(actualCompletions, expectedCompletions);
}
@@ -2656,7 +2657,7 @@ void CppToolsPlugin::test_completion_data()
<< QLatin1String("t")
<< QLatin1String("iterator"));
- QTest::newRow("pointer_partial_specialization") << _(
+ QTest::newRow("pointer_indirect_specialization") << _(
"template<typename T>\n"
"struct Traits { typedef typename T::pointer pointer; };\n"
"\n"
@@ -2684,6 +2685,35 @@ void CppToolsPlugin::test_completion_data()
) << _("t.p->") << (QStringList()
<< QLatin1String("Foo")
<< QLatin1String("bar"));
+
+ QTest::newRow("pointer_indirect_specialization_typedef") << _(
+ "template<typename T>\n"
+ "struct Traits { typedef typename T::pointer pointer; };\n"
+ "\n"
+ "template<typename _Tp>\n"
+ "struct Traits<_Tp*> { typedef _Tp *pointer; };\n"
+ "\n"
+ "struct Foo { int bar; };\n"
+ "\n"
+ "class Temp\n"
+ "{\n"
+ "protected:\n"
+ " typedef Foo *FooPtr;\n"
+ " typedef Traits<FooPtr> TraitsT;\n"
+ "\n"
+ "public:\n"
+ " typedef typename TraitsT::pointer pointer;\n"
+ " pointer p;\n"
+ "};\n"
+ "\n"
+ "void func()\n"
+ "{\n"
+ " Temp t;\n"
+ " @\n"
+ "}\n"
+ ) << _("t.p->") << (QStringList()
+ << QLatin1String("Foo")
+ << QLatin1String("bar"));
}
void CppToolsPlugin::test_completion_member_access_operator()