With GCC trunk, the following minimal usage of std::generator results in incorrect code: ```cpp #include <generator> #include <print> #include <vector> std::generator<int> get_seq() { std::vector<int> data_{1, 2, 3}; for (auto item : data_) co_yield item; } int main() { for (auto item : get_seq()) std::println("{}", item); } ``` The expected result, and what is outputted by GCC 14.2, is "1 2 3" on three lines. However, with the GCC trunk, only a single 0 is outputted. See https://godbolt.org/z/fE1593c9h.
Seems to have started with r15-3840-g650e9156656187.