We were missing a constraint in common_iterator's iterator_traits and
we were eagerly instantiating iter_value_t even when invalid.
Thanks to Casey Carter for finding this bug.
Differential D117449
[libc++] Fix common_iterator for output_iterators ldionne on Jan 16 2022, 7:24 PM. Authored by
Details
We were missing a constraint in common_iterator's iterator_traits and Thanks to Casey Carter for finding this bug.
Diff Detail
Event TimelineComment Actions Nice catch! That test is a mess, though. I don't object to landing this as-is, just to fix the bug; I would also be happy to merge it into D117400. Your call.
Comment Actions
I have a mild preference to merge this small fix as-is.
Comment Actions
Comment Actions Commandeering to fix common_iterator with output_iterator. I would have done it as part of a separate patch, but both are interdependent (I can't write tests for my part of the change without your changes). Comment Actions Fix common_iterator for output_iterator. Do you folks agree this is the right direction? Comment Actions I continue to think all of these directions are better than the status quo. Consider me still "accept"ing.
Comment Actions LGTM, with Arthur's comments. (Although I'm fine with the extra typename requirement in __can_use_postfix_proxy.)
Comment Actions Apply review comments.
Comment Actions I assume this is still OK, and still necessary, even after D117400 which I assume must have merge-conflicted with it a lot?
Comment Actions Yes, still necessary. There were only small merge conflicts.
Comment Actions The CI only failed on Windows due to missing space. I'm going to ship this now, and we can make adjustments post-commit if the discussion ends up bringing up additional issues.
|
Nit: Did you add line 34 to avoid prematurely instantiating iter_reference_t? Is it possible to regression-test for that? Should we? If removing line 34 would be conforming, I'd just do that.