Thanks for sharing the reproducer on a private channel.
The crash happens during parsing, where we recognize that there is no viable overload candidate for the call within the synthesized operator==() for your class because the default version will use std::equal(). The crash happens because if you user-provide the defaulted equality operator, then the declaration of the equality operator will be mentioned in the “no viable overloads found” diagnostics and that is where it crashes.
To unblock you I would recommend to check your code if the “no viable overloads found” diagnostic is valid and try to fix that, so that we wouldn’t diagnose it and try to construct a message for it and crashing.
Alternatively, or if that is not a valid error, you can always exclude the given file from the analysis using the sonar.exclusions option until we fix this crash.
Mind that leads to a slight semantic difference, on which you probably not depend on but I’m mention it anyway.
It’s that if you in the class define the function with = default; it means that it’s NOT “user-provided” but “auto synthesized”. It means that the rest of the special member functions will be generated by the compiler automatically.
On the other hand, if you only declare it and later specify it’s body as MyClass::specialmemberfn() = default; it means that it’s “user-provided” but we use the default version what the compiler would have generated. This means that the rest of the special member functions WON’T be “auto synthesized”.
It could be important if you expose the given class in some public APIs that ends up consumed by some user-code, and start depending on the fact that the rest of the special member functions exist/ doesn’t exist. So, making such changes is an ABI-breaking change.
To learn more about the meaning of “user-provided” and “defaulted” check out this StackOverflow post: