1

As shown in the screenshot from a valid C/C++ include file the using directive is not shown in the Outline section:

myInt is missing

How can I enable this?

My Eclipse version:

Eclipse IDE for C/C++ Developers

Version: Oxygen.2 Release (4.7.2)

Build id: 20171218-0600

Peter VARGA
  • 4,780
  • 3
  • 39
  • 75

1 Answers1

1

First, note that the construct circled in your screenshot is not a "using directive".

There are three syntactic constructs in C++ that start with the keyword using:

using namespace std;   // using directive
using std::vector;     // using declaration
using myint = int;     // alias declaration; new in C++11

(An alias declaration can also be templated, in which case it's often called a "template alias".)

Eclipse CDT does show using directives and using declarations in the outline view.

Alias declarations are new in C++11, and Eclipse CDT does not yet support showing them in the outline view. Bug 509120 is on file to track this.

HighCommander4
  • 50,428
  • 24
  • 122
  • 194
  • +1 because I didn't find this bug and explains all. Each Eclipse version I tested - in total 4 - didn't show it. Even in the include file the `alias declaration name` [`myint`] is not shown in the code completion either. – Peter VARGA Feb 18 '18 at 19:53
  • @AlBundy: I'm curious about the missing code completion you mention. Could you give an example? – HighCommander4 Feb 18 '18 at 19:57
  • OK. In Oxygen the completion works. In an older Eclipse version it didn't work. Sorry for that confusion. – Peter VARGA Feb 18 '18 at 20:08