llvm-project
c86c815f - [Sema] Fix lifetime extension for temporaries in range-based for loops in C++23 (#145164)

Commit
83 days ago
[Sema] Fix lifetime extension for temporaries in range-based for loops in C++23 (#145164) C++23 mandates that temporaries used in range-based for loops are lifetime-extended to cover the full loop. This patch adds a check for loop variables and compiler- generated `__range` bindings to apply the correct extension. Includes test cases based on examples from CWG900/P2644R1. Fixes https://github.com/llvm/llvm-project/issues/109793
Author
Parents
Loading