The diagnostic message should be used when indicating an error, as this report element indicates an error in the code semantically.
Right now the last bug path event is treated as the error because Clang static analyzer emits reports in format where diagnostic message is duplicated in the last position, this is a clangsa quirk and Codechecker should not rely on this behavior. For Cppcheck to work correctly the bug path event list is needed to be extended with the diagnostic message, which is a redundant step, as the diagnostic message also has a location.
The position of an error is critical from the point of report suppression, so the impact of this modification should be carefully examined, but a clearer error presentation would be desirable in the future.
This is a follow up to #3680
Also a follow up to #3721