RKSimon created this revision.
RKSimon added a reviewer: rsmith.
RKSimon requested review of this revision.
Herald added a project: clang.

As reported on https://pvs-studio.com/en/blog/posts/cpp/0771/ (Snippet 2) - 
(and mentioned on rGdc4259d5a38409 
<https://reviews.llvm.org/rGdc4259d5a38409e65b60266a7df0f03c3b91a151>) we are 
repeating the T1.isNull() check instead of checking T2.isNull() as well.

I'm not familiar with this code but it doesn't look like we have any test 
coverage that relies on the null tests.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107347

Files:
  clang/lib/Sema/SemaOverload.cpp


Index: clang/lib/Sema/SemaOverload.cpp
===================================================================
--- clang/lib/Sema/SemaOverload.cpp
+++ clang/lib/Sema/SemaOverload.cpp
@@ -9525,7 +9525,7 @@
   for (unsigned I = 0; I != NumParams; ++I) {
     QualType T1 = NextParam(F1, I1, I == 0);
     QualType T2 = NextParam(F2, I2, I == 0);
-    if (!T1.isNull() && !T1.isNull() && !Context.hasSameUnqualifiedType(T1, 
T2))
+    if (!T1.isNull() && !T2.isNull() && !Context.hasSameUnqualifiedType(T1, 
T2))
       return false;
   }
   return true;


Index: clang/lib/Sema/SemaOverload.cpp
===================================================================
--- clang/lib/Sema/SemaOverload.cpp
+++ clang/lib/Sema/SemaOverload.cpp
@@ -9525,7 +9525,7 @@
   for (unsigned I = 0; I != NumParams; ++I) {
     QualType T1 = NextParam(F1, I1, I == 0);
     QualType T2 = NextParam(F2, I2, I == 0);
-    if (!T1.isNull() && !T1.isNull() && !Context.hasSameUnqualifiedType(T1, T2))
+    if (!T1.isNull() && !T2.isNull() && !Context.hasSameUnqualifiedType(T1, T2))
       return false;
   }
   return true;
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to