Bug 187631 - Typedefs for nested template classes not considered in C++ Assistant
Summary: Typedefs for nested template classes not considered in C++ Assistant
Status: CONFIRMED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (Clang-based) (show other bugs)
Version: git master
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-19 20:20 UTC by Thomas McGuire
Modified: 2016-01-23 21:17 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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!