summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcompletion_test.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2015-03-30 00:29:24 +0300
committerOrgad Shaneh <orgads@gmail.com>2015-04-01 09:42:42 +0000
commit55ed8b861b42a69d4da597e5cb45c1bb0d62278a (patch)
tree067671eb1a3575e9caa0b531123c4807e891e965 /src/plugins/cpptools/cppcompletion_test.cpp
parentc12593efc44b5e98a1c7d6c2561f4b67bdbf383f (diff)
downloadqt-creator-55ed8b861b42a69d4da597e5cb45c1bb0d62278a.tar.gz
CppTools: Add 2 failing tests for double pointer indirection
... when resolving specialization Change-Id: Id3b673fa0c85b13f9a3b4bda022ef2ff18d4c2ac 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.cpp72
1 files changed, 72 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp
index e7671c1325..a754622134 100644
--- a/src/plugins/cpptools/cppcompletion_test.cpp
+++ b/src/plugins/cpptools/cppcompletion_test.cpp
@@ -321,6 +321,8 @@ void CppToolsPlugin::test_completion()
QEXPECT_FAIL("enum_in_class_accessed_in_member_func_inline_cxx11", "QTCREATORBUG-13757", Abort);
QEXPECT_FAIL("pointer_indirect_specialization", "QTCREATORBUG-14141", Abort);
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);
QCOMPARE(actualCompletions, expectedCompletions);
}
@@ -2714,6 +2716,76 @@ void CppToolsPlugin::test_completion_data()
) << _("t.p->") << (QStringList()
<< QLatin1String("Foo")
<< QLatin1String("bar"));
+
+ QTest::newRow("pointer_indirect_specialization_double_indirection") << _(
+ "template<typename _Tp>\n"
+ "struct Traits { };\n"
+ "\n"
+ "template<typename _Tp>\n"
+ "struct Traits<_Tp*> { typedef _Tp *pointer; };\n"
+ "\n"
+ "struct Foo { int bar; };\n"
+ "\n"
+ "template<typename _Tp>\n"
+ "struct IndirectT\n"
+ "{\n"
+ " typedef Traits<_Tp> TraitsT;\n"
+ " typedef typename TraitsT::pointer pointer;\n"
+ " pointer p;\n"
+ "};\n"
+ "\n"
+ "template<typename _Tp>\n"
+ "struct Temp\n"
+ "{\n"
+ " typedef _Tp *pointer;\n"
+ " typedef IndirectT<pointer> indirect;\n"
+ "};\n"
+ "\n"
+ "void func()\n"
+ "{\n"
+ " Temp<Foo>::indirect t;\n"
+ " @\n"
+ "}\n"
+ ) << _("t.p->") << (QStringList()
+ << QLatin1String("Foo")
+ << QLatin1String("bar"));
+
+ QTest::newRow("pointer_indirect_specialization_double_indirection_with_base") << _(
+ "template<typename _Tp>\n"
+ "struct Traits { };\n"
+ "\n"
+ "template<typename _Tp>\n"
+ "struct Traits<_Tp*> { typedef _Tp *pointer; };\n"
+ "\n"
+ "struct Foo { int bar; };\n"
+ "\n"
+ "template<typename _Tp>\n"
+ "struct IndirectT\n"
+ "{\n"
+ " typedef Traits<_Tp> TraitsT;\n"
+ " typedef typename TraitsT::pointer pointer;\n"
+ " pointer p;\n"
+ "};\n"
+ "\n"
+ "template<typename _Tp>\n"
+ "struct TempBase { typedef _Tp *pointer; };\n"
+ "\n"
+ "template<typename _Tp>\n"
+ "struct Temp : public TempBase<_Tp>\n"
+ "{\n"
+ " typedef TempBase<_Tp> _Base;\n"
+ " typedef typename _Base::pointer pointer;\n"
+ " typedef IndirectT<pointer> indirect;\n"
+ "};\n"
+ "\n"
+ "void func()\n"
+ "{\n"
+ " Temp<Foo>::indirect t;\n"
+ " @\n"
+ "}\n"
+ ) << _("t.p->") << (QStringList()
+ << QLatin1String("Foo")
+ << QLatin1String("bar"));
}
void CppToolsPlugin::test_completion_member_access_operator()