[clang] [clang][CFG] Fix range-for iterator initialization order (PR #234467)

Benedek Kaibas via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 22 11:55:20 PDT 2026


================
@@ -4989,8 +4989,8 @@ CFGBlock *CFGBuilder::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
 
   // Add the initialization statements.
   Block = createBlock();
-  addStmt(S->getBeginStmt());
   addStmt(S->getEndStmt());
+  addStmt(S->getBeginStmt());
----------------
benedekaibas wrote:

> so we know that this pretty much never worked.

Yes! It would be great to also see the discussion for these old commits, but it is what it is.

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


More information about the cfe-commits mailing list