================
@@ -4958,33 +4958,42 @@ SourceLocation DesignatedInitUpdateExpr::getEndLoc()
const {
}
ParenListExpr::ParenListExpr(SourceLocation LParenLoc, ArrayRef<Expr *> Exprs,
- SourceLocation RParenLoc)
+ SourceLocation RParenLoc,
+ ArrayRef<SourceLocation> CommaLocs)
: Expr(ParenListExprClass, QualType(), VK_PRValue, OK_Ordinary),
- LParenLoc(LParenLoc), RParenLoc(RParenLoc) {
+ LParenLoc(LParenLoc), RParenLoc(RParenLoc), NumCommas(CommaLocs.size()) {
+ assert((CommaLocs.empty() || CommaLocs.size() + 1 == Exprs.size()) &&
----------------
erichkeane wrote:
I kinda disagree, we SHOULD make sure we fill them in with 'invalid' locations,
if only for AST fidelity. In the case of the importer, I'd expect that will
later fill it in with the 'correct' locations anyway, correct/ Empty source
locations are cheap.
I think the 'default' argument here should go away, and we should require the
comma locs all the time, and force all callers to give us the comma locs, even
if they have to fill it with invalid.
https://github.com/llvm/llvm-project/pull/199411
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits