Bug 187631

Summary: Typedefs for nested template classes not considered in C++ Assistant
Product: [Applications] kdevelop Reporter: Thomas McGuire <mcguire>
Component: Language Support: CPP (Clang-based)Assignee: kdevelop-bugs-null
Status: CONFIRMED ---    
Severity: wishlist CC: craftplace.ms, david.nolden.kde
Priority: NOR    
Version First Reported In: git master   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Thomas McGuire 2009-03-19 20:20:10 UTC
Version:            (using Devel)
OS:                Linux
Installed from:    Compiled sources

Consider the following code snippet:

template<typename a, typename b>
class Outer
{
    class Inner {
    };

    Inner getInner() {};
};

typedef Outer<int,int> SmallOuter;

void test()
{
    SmallOuter outer;
    inner = outer.getInner();
}

Now, say the cursor is in the "inner = outer.getInner()" line.
KDevelop's assistant will now offer to add the type to "inner", which is really useful.
However, it doesn't consider typedefs here, i.e. it offers to add "Outer<int, int>::Inner", while it should offer "SmallOuter::Inner".

This actually happens very often, since that is exactly how iterators on template lists are structured.
Comment 1 David Nolden 2010-01-10 20:57:15 UTC
This is not easy to do, as the _real_ type of the object you're dealing with simply _is_  "Outer<int, int>::Inner", and nothing else. I guess I'll try to work around this at some point, but still marking it as wishlist item.
Comment 2 Andrey Cygankov 2016-01-23 21:12:38 UTC
I tried to reproduce the bug in KDevelop 5, judging by that has turned out, maybe he's still there.
http://i.imgur.com/dkrala2.png
Comment 3 Milian Wolff 2016-01-23 21:17:13 UTC
Thanks Andrey!