Hello, @Tom_Isaacson2
Indeed, at the moment we only detect trivially unreachable code with cpp:S1763, which does not cover your case.
We envision working on a more useful rule that would flag such invariant conditions as part of CPP-5167. We have no specific timeline for it.
Additionally, the next SonarQube Server release will provide a MISRA C++ 23 rule (0.0.2) “Controlling expressions should not be invariant” which should also detect such bugs. (Note that the rule is available to SonarQube Server users if you enable the additional setting for the preview of MISRA C++ 23 rules. We do not promise to keep these rules available for free once we have a more complete MISRA coverage).