Incorrect C++ S5414 because SonarLint identifies a private data member as public

Please provide

  • Operating system: Windows 10 21H2
  • SonarLint plugin version:
  • Programming language you’re coding in: C++
  • Is connected mode used: No

I’m getting a spurious S5414 (Do not mix public and private data members) for a class whose data members are all private.

SonarLint recognizes 7 of the class’s 8 data members as private, but for some reason it thinks #4 is public:

sonarlint bad s5414

Hi @Spencer ,

do you also analyze the same code on SonarQube or SonarCloud? If yes, are you experiencing the same report on both?

Could you please create a reproducer file as described on this page and share it? I can send you a private message if cannot share it here.