[PATCH] D141058: [clang-tidy] fix wrong fixup for bugprone-implicit-widening-of-multiplication-result

Vincent LE GARREC via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 9 04:39:44 PST 2023


bansan added a comment.

The current rule is quite simple. I tried this example:

  template<typename T>
  T h(int x) {
    return 1024 * 1024 * 1024 * x;
  }
  
  int main() {
    h<int64_t>(1024);
  }

The rule does not complain. So I think that the "resolved" type (`size_t`) should be use instead of the templated one (`std::vector<int, std::allocator<int>>::size_type`).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141058/new/

https://reviews.llvm.org/D141058



More information about the cfe-commits mailing list