[clang] [clang][analyzer] Handle CXXParenInitListExpr alongside InitListExpr (PR #136041)

Yanzuo Liu via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 17 09:35:56 PDT 2025


================
@@ -379,10 +379,12 @@ void DynamicTypePropagation::checkPostCall(const CallEvent &Call,
         // aggregates, and in such case no top-frame constructor will be called.
         // Figure out if we need to do anything in this case.
         // FIXME: Instead of relying on the ParentMap, we should have the
-        // trigger-statement (InitListExpr in this case) available in this
-        // callback, ideally as part of CallEvent.
-        if (isa_and_nonnull<InitListExpr>(
-                LCtx->getParentMap().getParent(Ctor->getOriginExpr())))
+        // trigger-statement (InitListExpr or CXXParenListInitExpr in this case)
+        // available in this callback, ideally as part of CallEvent.
+        const Stmt *Parent =
+            LCtx->getParentMap().getParent(Ctor->getOriginExpr());
+        if (isa_and_nonnull<InitListExpr>(Parent) ||
+            isa_and_nonnull<CXXParenListInitExpr>(Parent))
----------------
zwuis wrote:

```cpp
isa_and_nonnull<Expr1, Expr2>(...)
```

Ditto below.

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


More information about the cfe-commits mailing list