libstdc++: Skip tag dispatching for _S_relocate in C++17
authorJonathan Wakely <jwakely@redhat.com>
Tue, 30 Nov 2021 13:41:32 +0000 (13:41 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 30 Nov 2021 20:10:19 +0000 (20:10 +0000)
commit91c26004037db689954318d3d1c801eea18d45f4
treea84b5f3533e958baabe1bc7ffb52ca36e706b544
parentcca6090b13ab503bef1cfa327e2d107789d6bd30
libstdc++: Skip tag dispatching for _S_relocate in C++17

In C++17 mode all callers of _S_relocate have already done:

  if constexpr (_S_use_relocate())

so we don't need to repeat that check and use tag dispatching to avoid
ill-formed instantiations.

libstdc++-v3/ChangeLog:

* include/bits/stl_vector.h (vector::_S_do_relocate): Remove
C++20 constexpr specifier.
(vector::_S_relocate) [__cpp_if_constexpr]: Call __relocate_a
directly without tag dispatching.
libstdc++-v3/include/bits/stl_vector.h