[PATCH] D114427: [clang-tidy] Warn on functional C-style casts

Salman Javed via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 27 18:40:33 PST 2021


salman-javed-nz accepted this revision.
salman-javed-nz added a comment.
This revision is now accepted and ready to land.

LGTM, thanks!



================
Comment at: clang-tools-extra/test/clang-tidy/checkers/google-readability-casting.cpp:335
+  const char *str = "foo";
+  auto s = S(str);
+}
----------------
carlosgalvezp wrote:
> salman-javed-nz wrote:
> > Is a test to check `new int(x)` worth including? I see that the cpplint guys explicitly filter it out of their results.
> Sure, even though I think technically it's not a cast. At least it's not shown as such in the AST.
It's not a cast in the AST, but it's nice to document in the unit test that we have considered it and that that intend to treat it no differently to how cpplint treats it.


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

https://reviews.llvm.org/D114427



More information about the cfe-commits mailing list