[clang] [analyzer] Treat break, continue, goto, and label statements as trivial in WebKit checkers. (PR #91873)

Artem Dergachev via cfe-commits cfe-commits at lists.llvm.org
Tue May 14 19:37:34 PDT 2024


================
@@ -445,6 +456,10 @@ class TrivialFunctionAnalysisVisitor
     return Visit(VMT->getSubExpr());
   }
 
+  bool VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr* BTE) {
+    return Visit(BTE->getSubExpr());
----------------
haoNoQ wrote:

Which reminds me, I think we're also forgetting to check `CXXCtorInitializer`s. Because they aren't included in `CXXConstructorDecl->getBody()`. They also may be non-trivial.

Also need to double-check default function argument expressions. We probably don't need to handle them when we're jumping into a function from a call site. But if we're ever asking the analysis whether a function is safe outside of any caller context, we should probably traverse them manually. But I don't think we're actually asking that.

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


More information about the cfe-commits mailing list