How can I test the C++ Analyzer?

Hi Everyone,
I have read about the new capabilities of the C++ analyzer here: C++ analyzer helps developers to write C++17 compliant code
I would now like to test it. But it looks like I do not know how to do it. I understand that the analyzer is available in SonarCloud, and that I can use SonarCloud to analyze an open-source GitHub-hosted roject.
I have set up my account in SonarCloud: https://sonarcloud.io/organizations/akrzemi1/projects?sort=-name
I have linked two repositories:
https://github.com/akrzemi1/markable
https://github.com/akrzemi1/sonar_test

The former is a real library that my users use. It is header only, and SonarCloud reports it has no lines of code.
The later, I created on the fly using the source code from SonarSource blog article, just to check if any C++ error would be detected. But apparently, I need to do some more setup, as I get message “100% of your code is in languages unsupported by Automatic Analysis”.

So, I need some help fro the community:

  1. Is C++ Static analysis from SonarSource available for free for open-source GitHub projects?
  2. If so, are there some instructions out there that would help me enable my project for C++ static analysis?

Hi @akrzemi1,

yes, it is.

If you follow the new project tutorial it is going to tell you that “Automatic analysis” is not supported for C/C++ languages.

You can have a look at the documentation page: SonarCloud. You can find some links to example projects at the end of the page.

One note, for C/C++ the analysis entry points are compilation units. Which means, that if you have a header only library you will have to build/analyze the examples or test compilation units.