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

Vincent Hong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 9 04:58:22 PST 2023


v1nh1shungry added a comment.

> The rule does not complain.

Sorry, I'm confused. Could you please explain what you expect this example should achieve and what is "the rule"? Thanks!

> 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).

Note: the "desugared type" I mention is the **FULLY** desugared type, so it will achieve `unsigned long` instead of `size_t`. There is a method `QualType::getSingleStepDesugaredType()` which may get `size_t`, but I haven't had a try. But even though it works, this will still turn `int64_t` into `long`.

BTW, if you think the desugared type is better, which do you think is better, to get single step desugared or to get fully desugared?


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