================
@@ -17658,21 +17637,20 @@ void Sema::DiagnoseStaticAssertDetails(const Expr *E) 
{
       Expr::EvalResult Result;
       SmallString<12> ValueString;
       bool Print;
-    } DiagSide[2] = {{LHS, Expr::EvalResult(), {}, false},
-                     {RHS, Expr::EvalResult(), {}, false}};
-    for (unsigned I = 0; I < 2; I++) {
-      const Expr *Side = DiagSide[I].Cond;
+    } DiagSides[2] = {{LHS, Expr::EvalResult(), {}, false},
+                      {RHS, Expr::EvalResult(), {}, false}};
+    for (auto &DiagSide : DiagSides) {
----------------
davidstone wrote:

I don't think that would improve things. The names of the structured bindings 
would just match the name of the fields in the struct (in other words, I don't 
have a better local name than the name I'd get naturally). This means that 
structured bindings introduces the risk of naming them differently (leading to 
a bug caused by accidentally transposing the names) as well as a risk of 
someone updating the names in one place but not the other, causing them to go 
out of sync.

https://github.com/llvm/llvm-project/pull/169938
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to