This is actually three related commits in one:
commit 11d578daf3e499100b8126e9c8f574f58ebe6f2c (HEAD -> list-debug-mode) Author: Arthur O'Dwyer <arthur.j.odwyer@gmail.com> Date: Sun Apr 18 15:15:10 2021 -0400 [libc++] __bit_iterator's constructor needs explicit. commit 34df8a2d303a40ef1e498f9f86d3dd1d7610d3c0 Author: Arthur O'Dwyer <arthur.j.odwyer@gmail.com> Date: Sun Apr 18 14:10:16 2021 -0400 [libc++] __wrap_iter's constructor needs explicit; make it look like __list_iterator. The "regression test" is https://godbolt.org/z/7jv71vnjc , but in fact that test seems to be relying on a nonconformance in Clang's overload resolution algorithm: on Clang and ICC, `foo({0,0})` will prefer the public non-explicit constructor of `pair<int,int>` over the explicit constructor of `vector<int>::iterator`, but I think that's actually nonconforming. commit 1adf6ac48d2e255ff59e1851fb2f33861464b107 Author: Arthur O'Dwyer <arthur.j.odwyer@gmail.com> Date: Sun Apr 18 14:02:12 2021 -0400 [libc++] Give list::iterator the same constructor in debug and non-debug modes. Inlining will take care of the codegen; get rid of a lot of #ifs.
We're now always passing another parameter to the constructor, eating a register.
We don't want to pay that cost in non-debug mode.
There was a reason this code was written in this ugly manner.