[PATCH] D139114: [Clang][Sema] Enabled implicit conversion warning for CompoundAssignment operator.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 19 11:50:39 PST 2023


aaron.ballman added a comment.

In D139114#4059603 <https://reviews.llvm.org/D139114#4059603>, @fahadnayyar wrote:

> @aaron.ballman  do you think that we should call ```CheckImplicitConversion``` only for arithemetic compound assignment operators like +=, -=, /=, *= and %= ?
>
> For bitwiseAssign operators (|=, &=, ^=) and shiftAssign operators (<<= and >>=) we may have to check the semantics to understand what implicit conversions are allowed and what are not allowed and which of these we should include with ```-Wconversion``` flag.

Based on what @nathanchance was seeing in practice, I think it might make sense to only enable this for arithmetic compound assignments for the moment. Also, I think it makes sense to land the modified version of this after the Clang 16 branch point so that we have more time for this functionality to bake before we unleash it on the world at large.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139114



More information about the cfe-commits mailing list