Skip to main content
Stepan Martinek
Associate II
November 29, 2021
Question

CubeIDE 1.8.0 and C++17 support

Hello.

CubeIDE 1.8.0 now includes STM32 toolchain based on GCC 10.3.1 which supports C++20, but the IDE still can't correctly parse C++17 syntax, like Class Template Argument Deduction guides.

I tried to force '-std=c++17' option to Language Settings Proveder (it worked for C++11 few years ago) but with no success. Are there any plans to fix this?

This topic has been closed for replies.

4 replies

Markus GIRDLAND
ST Employee
December 2, 2021

Hello Stepan!

I have written a ticket to the development team about adding support for C++17. I will update this discussion once I hear anything back. (Internal ticket number 118796)

PS: Internal tracking number is not accessible or usable by customers

Stepan Martinek
Associate II
December 2, 2021

Hello,

Thank you for raising this up. Small update:

Adding `-std=c++17` to settings provider actually has a slight effect. It makes the macro `__cplusplus` to have a value of 201703L instead of 201402L so some language features like std::optional becomes correctly defined, but indexer still does not understand the new syntax like CTAD mentioned in original post.

Connected to this, LL and HAL libraries are not compatible to C++17 because they frequently use the `register` keyword which has been removed in C++17. I will post a separate issue for that.

Stepan Martinek
Associate II
December 2, 2021

Update²:

The `register` keyword issue seems to be fixed in the newest releases of CMSIS and LL libraries, however it's still present in many example projects.

Markus GIRDLAND
ST Employee
December 3, 2021

Hello again Stepan,

The toolchain itself supports C++17. However, what you are mentioning about the indexer is not planned to be supported. At least not from our side. There was a decision taken in CDT that, unless someone steps forward and start working on the indexer, they won't fully support C++17.

We don't have the resources to do it, so we will just follow CDT in this regard.