@@ -637,9 +637,10 @@ void ExprEngine::handleConstructor(const Expr *E,
637637 // FIXME: For now this code essentially bails out. We need to find the
638638 // correct target region and set it.
639639 // FIXME: Instead of relying on the ParentMap, we should have the
640- // trigger-statement (InitListExpr in this case) passed down from CFG or
641- // otherwise always available during construction.
642- if (isa_and_nonnull<InitListExpr>(LCtx->getParentMap ().getParent (E))) {
640+ // trigger-statement (InitListExpr or CXXParenListInitExpr in this case)
641+ // passed down from CFG or otherwise always available during construction.
642+ if (isa_and_nonnull<InitListExpr, CXXParenListInitExpr>(
643+ LCtx->getParentMap ().getParent (E))) {
643644 MemRegionManager &MRMgr = getSValBuilder ().getRegionManager ();
644645 Target = loc::MemRegionVal (MRMgr.getCXXTempObjectRegion (E, LCtx));
645646 CallOpts.IsCtorOrDtorWithImproperlyModeledTargetRegion = true ;
@@ -1010,7 +1011,8 @@ void ExprEngine::VisitCXXNewExpr(const CXXNewExpr *CNE, ExplodedNode *Pred,
10101011 // values are properly placed inside the required region, however if an
10111012 // initializer list is used, this doesn't happen automatically.
10121013 auto *Init = CNE->getInitializer ();
1013- bool isInitList = isa_and_nonnull<InitListExpr>(Init);
1014+ bool isInitList =
1015+ isa_and_nonnull<InitListExpr, CXXParenListInitExpr>(Init);
10141016
10151017 QualType ObjTy =
10161018 isInitList ? Init->getType () : CNE->getType ()->getPointeeType ();
0 commit comments