False positive cpp:S1000 in source files

Make sure to read this post before raising a thread here:

Then tell us:

  • What language is this for?
    C++
  • Which rule?
    Header files should not contain unnamed namespaces (cpp:S1000)
  • Why do you believe it’s a false-positive/false-negative?
    The rule is triggered on implementation source files.
    It should be only be evaluated in header files.
  • I am using
    • SonarQube Cloud
    • SonarQube for IDE 4.42.0 in VSCode 1.108.2
      • in connected mode with SonarQube Cloud
  • How can we reproduce the problem?

In a .cpp file:

namespace
{
    void f() {}
}

Screenshot as proof:

Forgot to add, this is new behaviour.
Didn’t happen last week.

Thanks for your report!

I tried to reproduce this issue, but was not able to.

Can you share a reproducer? If you want to share it privately, please let me know, then I’ll sent you a DM.

That would probably be best.

Please remind me how to create one.