[PATCH] D151187: [doc] Add casting style preference to coding standards

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 10:46:01 PDT 2023


mehdi_amini added a comment.

In D151187#4364070 <https://reviews.llvm.org/D151187#4364070>, @barannikov88 wrote:

> Maybe adopt this clang-tidy check? https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/pro-type-cstyle-cast.html
> That is, allow C/functional-style cast when it is known to be safe (like unsigned -> int64_t or enum -> int), and prefer named casts otherwise.
> The check also provides fix-its, which is nice.

This is pretty nice! If it was possible to make it a clang warning instead of a tidy check (not clear to me why this can't be?), then we could make it a Werror and actually enforce it!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151187



More information about the llvm-commits mailing list