https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92852
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- Aha. Reduced testcase: struct S { int operator<<(const int &); } glob; void foo() { S& message_stream = glob; auto format = [&message_stream](auto && x) { message_stream << x ;}; format(3); format(4u); }