[clang] [Analyzer][CFG] Correctly handle rebuilt default arg and default init expression (PR #117437)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 31 08:44:45 PST 2025


================
@@ -5570,8 +5570,10 @@ ExprResult Sema::BuildCXXDefaultArgExpr(SourceLocation CallLoc,
           /*SkipImmediateInvocations=*/NestedDefaultChecking))
     return ExprError();
 
+  Expr *RewrittenExpr = Init == Param->getDefaultArg() ? nullptr : Init;
----------------
erichkeane wrote:

```suggestion
  Expr *RewrittenExpr = (Init == Param->getDefaultArg() ? nullptr : Init);
```

MINOR preference to reverse this condition?  But not sure enough to suggest this.

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


More information about the cfe-commits mailing list