Community
Participate
Working Groups
Alias templates do not show up in the C/C++ outline view. My guess is they don't even get model elements built for them.
Code to reproduce: template<class T> struct foo { int a; }; template<class T> using bar = foo<T>; bar<void> x; x. // <--------- No candidates are shown
(In reply to Nana Sakisaka from comment #1) > Code to reproduce: > > template<class T> > struct foo > { > int a; > }; > > template<class T> > using bar = foo<T>; > > bar<void> x; > x. // <--------- No candidates are shown This is a different issue, and is already fixed for 9.2.1 (assuming the "x." line is placed at function scope or in another context where an expression is expected).
(In reply to Nathan Ridge from comment #2) > This is a different issue, and is already fixed for 9.2.1 Actually, it works in 9.2.0 (latest released version) as well. What version were you testing with? Or were you trying to perform completion in declaration context?
> Or were you trying to perform completion in declaration context? Whoops, I was doing that. Sorry. I didn't know Eclipse is incapable of that... I just thought Eclipse's completion feature was some kind of a magic wand.
(In reply to Nana Sakisaka from comment #4) > > Or were you trying to perform completion in declaration context? > > Whoops, I was doing that. Sorry. > I didn't know Eclipse is incapable of that... I just thought Eclipse's > completion feature was some kind of a magic wand. Eclipse can perform completion in declaration context if you are writing code that is valid in declaration context. For example: template<class T> struct foo { struct nested {}; }; template<class T> using bar = foo<T>; bar<void>::/*cursor*/ Here, "nested" is offered as a completion proposal. However, in your case, there is no valid code that would start with "x." in that context, so no completion proposals are offered.
Note that this is not specific to template aliases. C++11 alias declarations of any kind are not shown in the outline view, including non-template aliases like: using T = int;