Details
-
Bug
-
Resolution: Done
-
P2: Important
-
Qt Creator 3.4.0-rc1
-
None
Description
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.
Attachments
Issue Links
- is required for
-
QTCREATORBUG-8922 Code completion does not work for std::vector of objects
- Closed