Thanks @Alexandre_Gigleux
As C++20 is technical approved since September I want to rise the question what is SonarQube planning with this in mind. The C++ compiler support - cppreference.com are not feature complete yet but they yre on their way.
Thanks @Alexandre_Gigleux
As C++20 is technical approved since September I want to rise the question what is SonarQube planning with this in mind. The C++ compiler support - cppreference.com are not feature complete yet but they yre on their way.
I moved your question to the āSuggest new featuresā category in order to measure how popular this feature request is.
Do you have in mind some rules that would work well to get the best of C++20 standard?
Some should be easy going and a start could be:
[[nodiscard]]
, i.e. prefer [[nodiscard(...)]]
constinit
if an constexpr is initialized with a const object or valueHello @milbrandt,
Would you mind digging a little bit deeper in some of the suggestions you made?
constinit
if an constexpr is initialized with a const object or valueWhy would you do that? constexpr
provides additional guarantees over constinit
(for instance, it implies const
), and I believe that in most cases, replacing constexpr
by constinit
would make the code less safe and less efficient. The places where constinit
make more sense I believe are exactly places where you could not before put constexpr
, and had to hope the the initialization would happen at compile time.
Did I miss something?
I assume you are referring to Resolving Core Issue #1331 (const mismatch with defaulted copy constructor)
I do not see what rule you expect out of this. Could you please share some example?
The standard says (9.12.6§1):
The attribute-tokens
likely
andunlikely
shall appear at most once in each attribute-list and no attribute-argument-clause shall be present. The attribute-tokenlikely
shall not appear in an attribute-specifier-seq that contains the attribute-tokenunlikely
.
So, what you suggests should already be enforced by the compiler. I donāt see where you think a rule would add some value here?
Before defining our strategy with C++20, we need to do some preliminary tests, that we currently plan to do early 2021.
On your side, can you tell us more about your needs regarding C++20? Do you use it for production code? Are you working with SonarQube or SonarCloud :sonarcloud:? If you use SonarQube
, do you usually use the latest version, or the LTS version?
Thank you,
Hello @JolyLoic,
we are using Visual Studio 2019 (16.8.x). Currently we are upgrading our projects from C++11 to C++17. Also the team had a look on C++latest (subset of C++20) and was reluctant to go the step. Code analysis availability with with SonarQube would be an argument in favour to go on this road.
At the moment we are still using Deeloper Edition 8.4.1 with Azure DevOps Server 2019. There are already some (upcoming) features I would like to get (C++17, monorepo and Azure DevOps Services integration) thus Iāll push on upgrading soon.
Thank you for sharing this information with us @milbrandt!
Hello any update on Sonar support for c++20?
We have our teams upgrading from c++17 to c++20 and they are not able to use Sonar on those projects anymore.
We have Sonar Developer Edition.
Thanks,
Francisc
Hello @fmunteanu ,
We are working on the subject, but our final plan is not decided yet. Iām going to ask you some questions to help us make the best plan possible:
Do you use C++20 for production code? Are you working with SonarQube or SonarCloud :sonarcloud:? If you use SonarQube
, do you usually use the latest version, or the LTS version?
There are some features of C++20 that will need more time to be supported, do you know what features are currently used by your teams?
Thank you!
Hello @JolyLoic ,
we do run sonar on C++ production code, and we have SonarQube versione: 8.4.2.36763
The C++ team is interested in:
short term:
In medium/long term also:
Thanks,
Francisc
Thank you for these information. Iāll let you know when we have more detailed plans to share.
Meanwhile, if other people want to share their views wrt C++20, they are welcomed to do so here!
Hello.
Let me point you to our latest C++ related announcement.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.