forked from qt-creator/qt-creator
CppTools: Add 2 failing tests for double pointer indirection
... when resolving specialization Change-Id: Id3b673fa0c85b13f9a3b4bda022ef2ff18d4c2ac Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
c12593efc4
commit
55ed8b861b
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user