I’m neither working for Sonar, nor am I a C++ programmer, but I know (from the .NET code base) more or less how this rule is (most likely) implemented. Long story short, it is a relatively loose educated guess, and for good reasons: you do not want to spend to many computations on this one.
As as far as I know, there are for - the multiple languages it has been implemented in - not too many false positives. If they try do change the analysis base on this report, I can not tell.
That all being said, I think it is a false positive, and an easy work around will most likely be:
As @Corniel mentioned, this rule is based on pretty loose heuristics and can fail. But we could probably add an exception for anything tagged // MARK:.
I’m not sure when this will be prioritized, but I created a ticket to track that task.
In a similar style, Xcode also has special handling for // TODO: and // FIXME: – but this behaviour is (partially) shared with most other IDEs (Clion, Eclipse, …).
However, since a least // TODO: is already covered by S1135, it probably makes sense to include these tags as exceptions as well.