https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101367
--- Comment #5 from Noah Watkins ---
Got it. Thanks for clarifying, I must have misinterpreted your earlier comment.
On Mon, Aug 9, 2021 at 8:06 PM davidledger at live dot com.au
wrote:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101367
>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101367
--- Comment #3 from Noah Watkins ---
Happy to work on providing a different reproducer if it is helpful.
This was the first smallish example we could create, and the `free of
an invalid pointer error` seemed as good enough as any unexpected
beha
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101367
--- Comment #1 from Noah Watkins ---
In the reproducer there are no errors for:
generator f() {
co_yield resource{[]{}};
}
but `free(): invalid pointer` occurs for:
generator f() {
std::string s;
co_yield resource{[s]{}};
}
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101367
Bug ID: 101367
Summary: [coroutines] destructor for capture in lambda
temporary operand to co_yield expression called twice
Product: gcc
Version: 12.0
Status: UNCONFIRME