gpetit
(Gaspard Petit)
January 19, 2021, 2:23am
1
Version
SonarLint v4.29.0.25125
Steps
When validating the following code:
namespace foo {
template<typename T>
struct bar {};
}
Expected behaviour:
SonarLint should not report that the namespace is empty
Observed behaviour
SonarLint reports cpp:S3261 Remove this empty namespace
Related issues
Using SonarLint for Visual Studio 2019 v4.24.0.20196 in MS Visual Studio Professional 2019 v16.6.5.
In Visual Studio many of my C++ files have the “Remove this empty namespace” warning next to namespaces that are patently not empty! All the lines in these files have green squiggles under them which makes the files difficult to read. Strangely, some of the C++ files without empty namespaces don’t have this warning, as I would expect, but it’s not obvious what’s different about those files.
Wh…
https://jira.sonarsource.com/browse/CPP-2614 (linked from the community issue above, I don’t have access to this jira issue)
JolyLoic
(Loïc Joly)
January 19, 2021, 9:48am
2
Hello @gpetit ,
I tried to reproduce your situation, but in my case the namespace was not detected as empty. Did you have anything before in your code that could interfere with this? Can you try to see if, in an empty project, you still reproduces this? (and if yes, can you send us this empty project?).
Thank you!