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

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


================
@@ -206,23 +221,42 @@ class StdVariantChecker : public Checker<eval::Call, check::RegionChanges> {
     if (!ThisMemRegion)
       return;
 
+    // Get the first type alternative of the std::variant instance.
+    assert((ThisSVal.getType(C.getASTContext())->isPointerType() ||
+            ThisSVal.getType(C.getASTContext())->isReferenceType()) &&
----------------
NagyDonat wrote:

Why do we need to allow references here? Is this connected to the freshly introduced "explicit object parameter" feature?

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


More information about the cfe-commits mailing list