[clang] [clang][analyzer] Detect use-after-move for 3-arg std::move (PR #196602)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Wed May 13 08:01:41 PDT 2026


================
@@ -495,6 +503,49 @@ void MoveChecker::checkPostCall(const CallEvent &Call,
   assert(!C.isDifferent() && "Should not have made transitions on this path!");
 }
 
+bool MoveChecker::evalCall(const CallEvent &Call, CheckerContext &C) const {
----------------
Xazax-hun wrote:

What is the main reason for using `evalCall` as opposed to  `checkPostCall`? 

When we use `evalCall` we need to model all aspects of the function, e.g., setting up all the bindings in the analysis state to model what the function would do. And only ever one checker can do `evalCall` for a function. If the main purpose is to update checker specific state, it is usually better to use `checkPostCall`. 

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


More information about the cfe-commits mailing list