[clang] [FlowSensitive] [StatusOr] invalidate StatusOr ptr argument of function calls (PR #180281)

Jan Voung via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 9 07:30:17 PST 2026


================
@@ -1309,6 +1338,8 @@ buildTransferMatchSwitch(ASTContext &Ctx,
                                        transferStatusOrConstructor)
       .CaseOfCFGStmt<CXXConstructExpr>(isStatusConstructor(),
                                        transferStatusConstructor)
+      .CaseOfCFGStmt<CallExpr>(isNonConstStatusOrPtrArgumentCall(),
----------------
jvoung wrote:

Hmm, my main worry is how these `CaseOfCFGStmt` only run transfer function (unless you explicitly delegate to another one). For example, what if there is a function that returns a StatusOr, but also takes a non-const pointer to a StatusOr ?

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


More information about the cfe-commits mailing list