summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcompletion_test.cpp
diff options
context:
space:
mode:
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()