================ @@ -17626,6 +17626,25 @@ class SequenceChecker : public ConstEvaluatedExprVisitor<SequenceChecker> { for (unsigned I = 0; I < Elts.size(); ++I) Tree.merge(Elts[I]); } + + void VisitCXXParenListInitExpr(const CXXParenListInitExpr *PLIE) { + // C++20 parenthesized list initializations are sequenced. See C++20 + // [decl.init]p17.5 and [decl.init]p17.6.2.2 + SmallVector<SequenceTree::Seq, 32> Elts; + SequenceTree::Seq Parent = Region; + for (const Expr *E : PLIE->getInitExprs()) { + if (!E) + continue; + Region = Tree.allocate(Parent); + Elts.push_back(Region); + Visit(E); + } + + // Forget that the initializers are sequenced. + Region = Parent; + for (unsigned I = 0; I < Elts.size(); ++I) + Tree.merge(Elts[I]); + } ---------------- vapdrs wrote:
I can do you one better and also factor out code in `VisitCXXConstructExpr` too, however that does call into question the comment `// In C++11, list initializations are sequenced.` in that function which seems to be copy pasted from `VisitInitListExpr`. So if you want me to remove that, let me know. https://github.com/llvm/llvm-project/pull/83476 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits