================
@@ -173,9 +178,11 @@ static bool isDeclRefExprToReference(const Expr *E) {
   return false;
 }
 
-void DereferenceChecker::reportBug(const DerefBugType &BT,
-                                   ProgramStateRef State, const Stmt *S,
-                                   CheckerContext &C) const {
+void DereferenceChecker::reportDerefBug(const DerefBugType &BT,
+                                        ProgramStateRef State, const Stmt *S,
+                                        CheckerContext &C) const {
+  assert(&BT != &NullPointerArithmBug && "Invalid use of function");
+
----------------
NagyDonat wrote:

```suggestion
```
You don't need this assertion because it's already enforced by type system: the 
parameter `BT` is a `const DerefBugType &`, so it's impossible pass 
`NullPointerArithBug` (which is a plain `BugType`) to it. Strong typing is a 
nice feature :smile: 

https://github.com/llvm/llvm-project/pull/157129
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to