[clang] [Analyzer][CFG] Correctly handle rebuilt default arg and default init expression (PR #91879)
via cfe-commits
cfe-commits at lists.llvm.org
Mon May 13 08:20:32 PDT 2024
================
@@ -2433,6 +2429,30 @@ CFGBlock *CFGBuilder::VisitChildren(Stmt *S) {
return B;
}
+CFGBlock *CFGBuilder::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *Arg,
+ AddStmtChoice asc) {
+ if (Arg->hasRewrittenInit()) {
+ if (asc.alwaysAdd(*this, Arg)) {
+ autoCreateBlock();
+ appendStmt(Block, Arg);
+ }
+ return VisitStmt(Arg->getExpr(), asc);
+ }
+ return VisitStmt(Arg, asc);
----------------
yronglin wrote:
I've explicit specific `HasRewrittenInit` in `BuildCXXDefaultInitExpr` when construct `CXXDefaultInitExpr`. This solution is temporarily feasible, but it may not be a good way.
https://github.com/llvm/llvm-project/pull/91879
More information about the cfe-commits
mailing list