clang-tidy has a check for this case