blob: 8b9a3679bbc0d5be2a5266a5a9aab858e3dda874 [file] [log] [blame]
== C/C++ Development Tools
[[cdt-open-declaration]]
=== Open Declaration
==== C++11 "auto" variables
For variables whose type is declared with the C++11 `auto` keyword, Open Declaration on the `auto` opens the declaration of the deduced type.
==== Following includes in inactive code paths
Open Declaration can now follow `#include`s in inactive code paths.
==== Navigation to forward declaration of class template
Open Declaration http://eclip.se/483048[now supports] navigation from the definition of a class template to its forward declaration.
This can be useful in cases where some of the class template's template parameter have default arguments, as the default arguments may only be declared at the forward declaration.
image::images/cdt/CDTNavigateToFwdDeclBeforeV2.png[]
image::images/cdt/CDTNavigateToFwdDeclAfterV2.png[]
==== Open Declaration in assembly files
The Open Declaration action is now supported in assembly files.
image::images/cdt/CDTAssemblyOpenDeclBefore.png[]
image::images/cdt/CDTAssemblyOpenDeclAfter.png[]
The action works on #include directives and identifiers.
[[cdt-content-assist]]
=== Content Assist
==== Completion of member functions when taking the address
After a classname qualifier such as `MyClass::`, CDT generally only offers static methods as completion proposals, since nonstatic methods need to be called on an object.
However, sometimes the address of a nonstatic method is taken, usually to be passed as a callback. CDT now recognizes the `&MyClass::` form used to do this, and offers nonstatic methods as completion proposals.
image::images/cdt/CDTAddressofMethodCompletion.png[]
==== Improved content assist in inactive code
Content assist in inactive code (code disabled by an `#ifdef`) was improved. It's still not on par with content assist in active code, but completions for entities declared in active code preceding the point of invocation are now proposed.
==== Included files with no file extension
CDT now offers completion proposals for files with files extensions other than the usual C/C++ header file extensions
(such as `.h` or `.hpp`) when content assist is invoked in an `#include` directive. This is useful for libraries that use header names with no extensions, such as Qt or KDE, as well as scenarios where non-header files (such as resource files) are included.
image::images/cdt/CDTIncludeCompletionNoExtension.png[]
To avoid polluting content assist proposals with irrelevant files, in cases where a directory contains both files with the usual C/C++ header extensions, and other files, proposals for files in the first category are shown first.
==== Enhanced parameter hints
CDT's parameter hints have been enhanced. They now show the full signature of the function being called, including its return type, containing class (if it's a method), and whether it's virtual.
image::images/cdt/CDTEnhancedParameterHint.png[]
==== Constructor completion with uniform initialization syntax
CDT's content assist now recognizes constructor calls that use the C++11 uniform initialization syntax and offers completion proposals for the constructor(s).
image::images/cdt/CDTUniformInitConstructorCompletion.png[]
[[cdt-search]]
=== Search
==== Enclosing definition of macro reference
In the Search view, the enclosing definition (function and class if applicable) is now shown for macro references the way it is for references to other entities.
image::images/cdt/CDTEnclosingDefForMacroReference.png[]
[[cdt-placement-of-const]]
=== Placement of `const`
==== Choose the placement of `const` keyword
The `const` keyword can now be placed left or right to the type in a declaration specifier. A new preference sets the location (**Preferences > C/C++ > Code Style**):
image::images/cdt/CDTConstPlacementPreference.png[]
==== When CDT generates new source code
For example in a refactoring the `const` keyword will be written accordingly:
image::images/cdt/CDTConstPlacementInRefactoringPreview.png[]
==== To adapt all `const` occurrences in the current file
There is an action *Align Const* in the *Source* menu (Mnemonic `ctrl+shift+A`):
image::images/cdt/CDTAlignConstSourceAction.png[]
[[cdt-folding-comments]]
=== Folding Comments
==== Folding of Comments Improvements
Some improvements have been made to folding comments. Documentation comments can now fold together when using *///* style comments. In addition new preferences on initial folding state of comments have been provided.
image::images/cdt/CDT_9_3_New_Folding_comments.png[]
[[cdt-code-analysis]]
=== Code Analysis
[[cdt-gcc-build-quick-fixes]]
==== GCC Build Quick-fixes
Quick fixes have been added for a variety of build errors generated by the gcc compiler. Such fixes include:
* missing semi-colon
image::images/cdt/CDTSemicolonFixitV2.png[]
* specification of wrong member (gcc 6 and above).
image::images/cdt/CDTWrongMemberFixitV2.png[]
* use of `.` operator instead of `pass:[->]`
image::images/cdt/CDTNeedPtrV2.png[]
* use of `pass:[->]` operator instead of `.`
image:images/cdt/CDTNeedDotV2.png[]
==== Support for `-fdiagnostics-parseable-fixits`
Clang and gcc 7 have support for generating fix-it suggestions for various compiler errors. When the `-fdiagnostics-parseable-fixits` option is specified for the build, CDT is able to parse these fix-it messages and generate quick-fixes for them.
image::images/cdt/CDTParseableFixitsV2.png[]
[[cdt-parser]]
=== Parser
==== More accurate binding resolution
This release fixes a
https://bugs.eclipse.org/bugs/show_bug.cgi?id=402498[long-standing issue] where the indexer would resolve names in a source file that referenced entities that did not have a declaration in any file included by that source file, only in other files in the project.
As a result of this change, the set of semantic errors produced by the indexer should more closely resemble what an actual compiler produces.
==== Exposing the CDT version number for feature-testing
CDT defines the `__CDT_PARSER__` macro while parsing code. This allows having a block of code in a preprocessor branch that CDT sees but the compiler does not, or vice versa, which can be useful for working around CDT limitations.
Previously, the value of this macro was `1`. Now it encodes the CDT version as well, so that e.g. for CDT version 9.2.1, the value of the macro is `90201`.
==== C++14 Language Support
Support for two new C++14 language features has been added: https://bugs.eclipse.org/bugs/show_bug.cgi?id=408470[return
type deduction] and https://bugs.eclipse.org/bugs/show_bug.cgi?id=516627[generic lambdas].
[[cdt-build]]
=== Build
==== Prebuild task and parallel make
Pre-build tasks and parallel make is now working together. Pre-build tasks can be used to generate header and source files as the pre-build task is now guaranteed to complete before any source code is built.
Also, the build targets under **Project Settings > C/C++ Build > Behavior > Workbench Build Behavior** is respected and works the same for projects both with and without pre-build tasks.
==== Build console speed up
Doing builds in CDT are now significantly faster when there is a lot of output, warnings, and/or errors.
The benefits of this improvement are:
* The build time in CDT compared to master is *much* faster, with speedups most significant on builds where large number of warnings or
errors are generated. (For example a file with 10,000 warnings is now 25x faster build time.)
* The build time in CDT is comparable to running in a terminal for most projects.
* The cancel button cancels the build fairly instantaneously
* The implementation is designed to limit the amount of UI thread used to ensure the UI stays responsive.
* The "took" time reported at the end of the build is accurate
==== .SECONDARY removed from generated Makefiles
In this release of CDT *.SECONDARY:* with no dependencies has been removed from the generated Makefiles. .SECONDARY with no dependencies can allow a build to succeed even if some dependencies are required. In the unlikely event that a project was depending on such behaviour the behaviour can be restored by creating a *makefile.targets* in the root of the project with *.SECONDARY:* as the file's contents.
[[cdt-debug]]
=== Debug
==== Support to extend the toolbar of the Debugger Console pages
Just like the standard Console view, the Debugger Console view now allows the use of the http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fextension-points%2Forg_eclipse_ui_console_consolePageParticipants.html[Console Page Participants] extension point. By using this extension, extenders can add buttons to the toolbar of the different pages of the Debugger Console view. An example of such additions can be found in _org.eclipse.cdt.examples.dsf.gdb/GdbExtendedConsolePageParticipant.java_ and has been copied below.
....
<extension point="org.eclipse.ui.console.consolePageParticipants">
<consolePageParticipant
class="org.eclipse.cdt.examples.dsf.gdb.ui.console.GdbExtendedConsolePageParticipant"
id="org.eclipse.cdt.examples.dsf.gdb.debuggerConsolePageParticipant">
<enablement>
<and>
<instanceof value="org.eclipse.cdt.debug.ui.debuggerconsole.IDebuggerConsole"/>
<!-- The below check only works with the Debugger Console view and not the
standard console view. But that is ok since this contribution is
for the Debugger Console views only. -->
<with variable="org.eclipse.core.runtime.Platform">
<test property="org.eclipse.core.runtime.bundleState"
args="org.eclipse.cdt.examples.dsf.gdb"
value="ACTIVE">
</test>
</with>
</and>
</enablement>
</consolePageParticipant>
</extension>
....
Furthermore, a new method was added to provide access to the full console widget. This allows to modify or extend the behaviour of the full GDB console. The method in question is _GdbFullCliConsolePage#getTerminalViewControl()_ which returns an __ITerminalViewControl__. ConsolePageParticipants are provided with the console page in their _init()_ method; they can then cast it to _GdbFullCliConsolePage_ to access the __ITerminalViewControl__.
[[cdt-source-not-found-editor-modifications]]
==== Source not found editor modifications
Users now have three choices to display the source not found editor:
* Source you were jumping into is not found;
* Function name known but can't find its source;
* Unknown function name
image::images/cdt/CDTCSourceNotFoundEditorV2.png[]
[[cdt-launch-group]]
=== Launch Group
==== Launch Group now part of Eclipse Platform :
The Launch Group feature of CDT has been promoted to the Eclipse Platform. The version in CDT has been deprecated and will be removed in a future version.
The new Launch Group type can be identified by the image:images/cdt/CDT_NEW93_Launch_Group.png[width=32,height=32] icon and the deprecated Launch Group has "(deprecated)" in its title.
[[cdt-arduino-c]]
=== Arduino C++
==== Support for Arduino
Added support for Arduino serial connections to use the TM Terminal's new CDT Serial Port terminal connector.
image::images/cdt/Screen_Shot_2017-05-31_at_10.46.38_AM.png[]