• Orgad Shaneh's avatar
    C++: Fix specialization resolution for nested types · ad4cb444
    Orgad Shaneh authored
    
    
    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: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
    ad4cb444
LookupContext.cpp 71.3 KB