[clang] [sema] Improve -Wsign-compare (PR #65684)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 8 08:37:24 PDT 2023


================
@@ -14308,22 +14382,22 @@ static bool AnalyzeBitFieldAssignment(Sema &S, FieldDecl *Bitfield, Expr *Init,
 
 /// Analyze the given simple or compound assignment for warning-worthy
 /// operations.
-static void AnalyzeAssignment(Sema &S, BinaryOperator *E) {
+void ImplicitConversionChecker::AnalyzeAssignment(BinaryOperator *E) {
   // Just recurse on the LHS.
-  AnalyzeImplicitConversions(S, E->getLHS(), E->getOperatorLoc());
+  AnalyzeImplicitConversions(E->getLHS(), E->getOperatorLoc(), false, true);
----------------
shafik wrote:

```suggestion
  AnalyzeImplicitConversions(E->getLHS(), E->getOperatorLoc(), /*IsInitList=*/false, /*IsTopLevelExpr=*/true);
```

https://github.com/llvm/llvm-project/pull/65684


More information about the cfe-commits mailing list