I have this, which causes no warnings, either in the IDE or when compiled:
int out_len1 = 1;
int out_len2 = 1;
int out_len = out_len1 + out_len2;
But when I remove the intermediate variable:
rtext.resize(static_cast<unsigned long>(out_len1 + out_len2));
... the IDE pops up a Clang-tidy warning "Clang-Tidy: Either cast from 'int' to 'unsigned long' is ineffective, or there is loss of precision before the conversion".
So no problem, I follow the suggestion light bulb and suppress the warning:
rtext.resize(static_cast<unsigned long>(out_len1 + out_len2)); // NOLINT(bugprone-misplaced-widening-cast)
This stops the IDE warning, but when I commit the code with Git, with "Perform code analysis" enabled, I still get (the same) warning.
Is there some Clang-tidy option I missed here, or is this a bug?