Author: Fangrui Song
Date: 2024-05-04T15:27:52-07:00
New Revision: 4dede5ef5ca7e538351975130b1c1d863a84e4ca

URL: 
https://github.com/llvm/llvm-project/commit/4dede5ef5ca7e538351975130b1c1d863a84e4ca
DIFF: 
https://github.com/llvm/llvm-project/commit/4dede5ef5ca7e538351975130b1c1d863a84e4ca.diff

LOG: [Sema] Remove redundant check in an else branch. NFC

after https://reviews.llvm.org/D83788

Fix #91090

Added: 
    

Modified: 
    clang/lib/Sema/SemaExpr.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 7190e50b156f7b..2557b1af8f024e 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -17208,11 +17208,11 @@ bool Sema::DiagnoseAssignmentResult(AssignConvertType 
ConvTy,
     }
     CheckInferredResultType = DstType->isObjCObjectPointerType() &&
       SrcType->isObjCObjectPointerType();
-    if (!CheckInferredResultType) {
-      ConvHints.tryToFixConversion(SrcExpr, SrcType, DstType, *this);
-    } else if (CheckInferredResultType) {
+    if (CheckInferredResultType) {
       SrcType = SrcType.getUnqualifiedType();
       DstType = DstType.getUnqualifiedType();
+    } else {
+      ConvHints.tryToFixConversion(SrcExpr, SrcType, DstType, *this);
     }
     MayHaveConvFixit = true;
     break;


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to