C++: Fix lookup for instantiation by class object

Task-number: QTCREATORBUG-14352
Change-Id: I2ce4bc1d0dba2414afe050e80607b581686081a9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2015-04-24 09:55:20 +03:00
committed by Orgad Shaneh
parent ee37f60bff
commit 9b30795c02
10 changed files with 99 additions and 81 deletions

View File

@@ -332,7 +332,6 @@ 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_indirect_specialization_double_indirection", "QTCREATORBUG-14141", Abort);
QEXPECT_FAIL("pointer_indirect_specialization_double_indirection_with_base", "QTCREATORBUG-14141", Abort);
QEXPECT_FAIL("recursive_instantiation_of_template_type", "QTCREATORBUG-14237", Abort);
QCOMPARE(actualCompletions, expectedCompletions);
@@ -2830,6 +2829,28 @@ void CppToolsPlugin::test_completion_data()
<< QLatin1String("Foo")
<< QLatin1String("bar"));
QTest::newRow("instantiation_of_indirect_typedef") << _(
"template<typename _Tp>\n"
"struct Indirect { _Tp t; };\n"
"\n"
"template<typename T>\n"
"struct Temp\n"
"{\n"
" typedef T MyT;\n"
" typedef Indirect<MyT> indirect;\n"
"};\n"
"\n"
"struct Foo { int bar; };\n"
"\n"
"void func()\n"
"{\n"
" Temp<Foo>::indirect i;\n"
" @\n"
"}\n"
) << _("i.t.") << (QStringList()
<< QLatin1String("Foo")
<< QLatin1String("bar"));;
QTest::newRow("pointer_indirect_specialization_double_indirection_with_base") << _(
"template<typename _Tp>\n"
"struct Traits { };\n"