This extension is a portability trap for users, since no other standard
library supports it. Furthermore, the Standard explicitly allows
implementations to reject std::allocator<cv T>, so allowing it is
really going against the current.
This was discovered in D120684: this extension required const_casting
in __construct_range_forward, a fishy bit of code that can be removed
if we don't support the extension anymore.
This is a re-application of dbc647643577, which was reverted in 9138666f5
because it broke std::shared_ptr<T const>. Tests have now been added and
we've made sure that std::shared_ptr<T const> wouldn't be broken in this
version.
I think this buries the lede a little bit. I'd say more like
I actually wonder whether this change matters to list<const T>, since it's a node-based container. Should you add libcxx/test/libcxx/.../const_element_type.verify.cpp tests that check what happens with const-qualified element types? If list<const T> and set<const T> still work in practice, should we continue kinda-sorta-supporting them, and document here that vector and deque are the only two containers that have been de-supported?