<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/69994>69994</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            _LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS breaks container constexpr-ness
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc++
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          jyknight
      </td>
    </tr>
</table>

<pre>
    As mentioned in #69466, if you set the `_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS` define, the restored allocator members are not constexpr, which leads to the vector and string types being non-constexpr too, because they find the deprecated allocator members, instead of going through allocator_traits as intended.

This is an extremely surprising result. 

Other `_LIBCPP_ENABLE_*_REMOVED_*` flags do not change the behavior of normal conforming C++17/20 code, but just restore standalone functions/types, not affecting code which doesn't use them. I think that's _generally_ a useful option to provide users of libc++, and would argue against removing _most_ ENABLE_CXXNN_REMOVED options. (And, further, argue for adding more for future standards).

However, if the option breaks required semantics or is tricky to implement without the risk of breaking required semantics, then we should not provide it. Allocators/allocator_traits are certainly a very tricky area in that regard. Thus, I propose that libc++ should remove both the option `_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS` and `_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_VOID_SPECIALIZATION`.

Sadly, Google's codebase is currently dependent upon this broken mode, and others may have similarly enabled it without realizing the negative impact. Thus, I propose to not _immediately_ remove the options, but to phase it in:
1. Now: announce the pending removal, stop implying them from the `_LIBCPP_ENABLE_CXX20_REMOVED_FEATURES` define, and update the documentation accordingly.
2. In early January: remove support (before next LLVM release branch).

@ilya-biryukov @ldionne 

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVU1T20gT_jXypQuXPDYGH3wwYN7XWwZShE2l9uJqaVrSxKMZ7UyPifbXb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