serialize_listlike() is called with a range of either managed_bytes or managed_bytes_opt. If the former, then iterating and assigning to a loop induction variable of type managed_byted_opt& will bind the reference to a temporary managed_bytes_opt, which gcc dislikes. Fix by performing the binding in a separate statement, which allows for lifetime extension.