[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


================
@@ -6083,31 +6083,44 @@ class ImplicitValueInitExpr : public Expr {
 
 class ParenListExpr final
     : public Expr,
-      private llvm::TrailingObjects<ParenListExpr, Stmt *> {
+      private llvm::TrailingObjects<ParenListExpr, Stmt *, SourceLocation> {
   friend class ASTStmtReader;
   friend TrailingObjects;
 
   /// The location of the left and right parentheses.
   SourceLocation LParenLoc, RParenLoc;
 
+  /// The number of comma locations stored after the expression list.
+  unsigned NumCommas;
----------------
erichkeane wrote:

Do we really need to separately store this?  Can we derive it from the statement count?  Also, it almost definitely shouldn't live in this type, and should be in the 'bits' type.

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


More information about the cfe-commits mailing list