[PATCH] D143971: Flag code with both string constructor arguments implicitly casted

Chris Cotter via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 13 18:27:01 PST 2023


ccotter created this revision.
Herald added a subscriber: carlosgalvezp.
Herald added a reviewer: njames93.
Herald added a project: All.
ccotter requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

Calls to the fill constructor where both arguments are
implicitly cast is confusing since the implicit cast may not be
apparent to the reader. In many cases, this is a programmer error. In
cases where it's not an error, the code should use explicit casts to
clearly specify intent.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D143971

Files:
  clang-tools-extra/clang-tidy/bugprone/StringConstructorCheck.cpp
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/bugprone/string-constructor.rst
  clang-tools-extra/test/clang-tidy/checkers/bugprone/string-constructor.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143971.497171.patch
Type: text/x-patch
Size: 10536 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230214/7bc6a372/attachment-0001.bin>


More information about the cfe-commits mailing list