-
Bug
-
Resolution: Done
-
P2: Important
-
Qt Creator 3.4.0-rc1
-
None
This looks like the final blocker for supporting stl iterators, at least the gcc implementation.
Test added in CppTools,test_completion:pointer_partial_specialization.
template<typename T>
struct Traits { typedef typename T::pointer pointer; };
template<typename _Tp>
struct Traits<_Tp*> { typedef _Tp *pointer; };
template<typename _Tp>
struct IndirectT
{
typedef Traits<_Tp> TraitsT;
typedef typename TraitsT::pointer pointer;
pointer p;
};
template<typename T>
class Temp
{
protected:
typedef Traits<T> TraitsT;
typedef T *TPtr;
public:
typedef typename TraitsT::pointer pointer;
typedef IndirectT<pointer> indirect;
pointer p;
indirect i;
};
struct Foo { int bar; };
class Temp2
{
protected:
typedef Foo *FooPtr;
typedef Traits<FooPtr> TraitsT;
public:
typedef typename TraitsT::pointer pointer;
pointer p;
};
void func()
{
Temp<Foo *> t;
Temp<Foo *>::indirect i;
Temp2 t2;
t.p->bar; // bar not highlighted
i.p->bar; // bar not highlighted
t2.p->bar; // bar not highlighted
}
My observation:
ClassOrNamespace::nestedType receives unexpanded Traits<T>. Then when it tries to find a specialization, T (as opposed to Foo *) is not a pointer, so the specialization is not determined.
- is required for
-
QTCREATORBUG-8922 Code completion does not work for std::vector of objects
-
- Closed
-
| For Gerrit Dashboard: QTCREATORBUG-14141 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 111141,6 | C++: Fix instantiation of typedefed type in block | master | qt-creator/qt-creator | Status: MERGED | +2 | 0 |
| 111289,11 | C++: Fix lookup for instantiation by class object | master | qt-creator/qt-creator | Status: MERGED | -2 | 0 |