[clang] [clang] Fix comma location tracking inside ParenListExpr. (PR #199411)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 22 08:39:55 PDT 2026


================
@@ -748,9 +748,17 @@ void ASTStmtReader::VisitParenListExpr(ParenListExpr *E) {
   unsigned NumExprs = Record.readInt();
   assert((NumExprs == E->getNumExprs()) && "Wrong NumExprs!");
   for (unsigned I = 0; I != NumExprs; ++I)
-    E->getTrailingObjects()[I] = Record.readSubStmt();
+    E->getTrailingObjects<Stmt *>()[I] = Record.readSubStmt();
   E->LParenLoc = readSourceLocation();
   E->RParenLoc = readSourceLocation();
+  if (Record.getIdx() < Record.size()) {
----------------
erichkeane wrote:

This check very much apperas to be a smell.  We shouldn't be checking the record size/location during serialization, this shows me that we have SOME sort of mismatch that you're trying to work around.

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


More information about the cfe-commits mailing list