forked from qt-creator/qt-creator
C++: Fix specialization resolution for nested types
Use-cases:
template<typename T>
struct Traits { typedef typename T::pointer pointer; };
template<typename _Tp>
struct Traits<_Tp*> { typedef _Tp *pointer; };
struct Foo { int bar; };
// 1
template<typename T>
class Temp
{
protected:
typedef Traits<T> TraitsT;
public:
typedef typename TraitsT::pointer pointer;
pointer p;
};
void func()
{
Temp<Foo *> t;
t.p-> // complete
}
// 2
class Temp2
{
protected:
typedef Foo *FooPtr;
typedef Traits<FooPtr> TraitsT;
public:
typedef typename TraitsT::pointer pointer;
pointer p;
};
void func2()
{
Temp2 t;
t.p-> // complete
}
Task-number: QTCREATORBUG-14141
Change-Id: Id3459671117c0c81bcde7c9714b42750634c0225
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
aa893918c1
commit
ad4cb444fb
@@ -330,12 +330,9 @@ 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", "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);
|
||||
QEXPECT_FAIL("recursive_instantiation_of_template_type", "QTCREATORBUG-14237", Abort);
|
||||
QEXPECT_FAIL("recursive_instantiation_of_template_type_2", "QTCREATORBUG-14141", Abort);
|
||||
QCOMPARE(actualCompletions, expectedCompletions);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user