[clang] Reapply "[Clang] Improve diagnostics for expansion length mismatch" (PR #121044)

via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 25 07:17:33 PDT 2025


================
@@ -756,125 +766,123 @@ bool Sema::CheckParameterPacksForExpansion(
     bool &RetainExpansion, std::optional<unsigned> &NumExpansions) {
   ShouldExpand = true;
   RetainExpansion = false;
-  std::pair<IdentifierInfo *, SourceLocation> FirstPack;
-  bool HaveFirstPack = false;
-  std::optional<unsigned> NumPartialExpansions;
-  SourceLocation PartiallySubstitutedPackLoc;
+  std::pair<const IdentifierInfo *, SourceLocation> FirstPack;
+  std::optional<std::pair<unsigned, SourceLocation>> PartialExpansion;
+  std::optional<unsigned> CurNumExpansions, CurMaximumOfLeastExpansions;
----------------
cor3ntin wrote:

Can we add comments?

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


More information about the cfe-commits mailing list