[PATCH] D132795: [clang-tidy] Tweak diagnostics for bugprone-assign-in-if-condition

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 27 12:45:23 PDT 2022


njames93 created this revision.
njames93 added reviewers: aaron.ballman, gribozavr2, LegalizeAdulthood, dodohand.
Herald added subscribers: carlosgalvezp, xazax.hun.
Herald added a project: All.
njames93 requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

Currently the diagnostic is printed at the start of the assignment expression, This can be misleading.
Having the location for the diagnostic be the location of the assignment operator is much more intuitive.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132795

Files:
  clang-tools-extra/clang-tidy/bugprone/AssignmentInIfConditionCheck.cpp
  clang-tools-extra/test/clang-tidy/checkers/bugprone/assignment-in-if-condition.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132795.456143.patch
Type: text/x-patch
Size: 4736 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220827/6e3ba555/attachment.bin>


More information about the cfe-commits mailing list