[PATCH] D107347: [Sema] haveSameParameterTypes - replace repeated isNull() test with assertions

Simon Pilgrim via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 18 04:15:03 PDT 2021


RKSimon updated this revision to Diff 380338.
RKSimon retitled this revision from "[Sema] haveSameParameterTypes - fix repeated isNull() test" to "[Sema] haveSameParameterTypes - replace repeated isNull() test with assertions".
RKSimon edited the summary of this revision.

Repository:
  rG LLVM Github Monorepo

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

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
@@ -9586,7 +9586,8 @@
   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))
+    assert(!T1.isNull() && !T2.isNull() && "Unexpected null param types");
+    if (!Context.hasSameUnqualifiedType(T1, T2))
       return false;
   }
   return true;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107347.380338.patch
Type: text/x-patch
Size: 590 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211018/3a07b9b6/attachment.bin>


More information about the cfe-commits mailing list