[clang] [analyzer] Variant checker bindings (PR #87886)

via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 8 09:10:46 PDT 2024


================
@@ -265,16 +305,22 @@ class StdVariantChecker : public Checker<eval::Call, check::RegionChanges> {
     }
 
     QualType RetrievedCanonicalType = RetrievedType.getCanonicalType();
-    QualType StoredCanonicalType = StoredType->getCanonicalType();
-    if (RetrievedCanonicalType == StoredCanonicalType)
+    QualType StoredCanonicalType = StoredType.getCanonicalType();
+    if (RetrievedCanonicalType.isNull() || StoredType.isNull())
----------------
NagyDonat wrote:

At this point the case where `StoredType.isNull()` is already ruled out. Either delete that check or replace it with `StoredCanonicalType.isNull()` if you think that is needed.

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


More information about the cfe-commits mailing list