[libc++] Move preferred_name declarations into the forward declaring headers and add pmr preferred names

We currently define the preferred names in multiple places. `basic_string` and `basic_string_view` also have a lot of aliases, which makes the declarations quite long. So let's only add the preferred names in forward-declaring headers to make the implementation more readable and have all the preferred names in one place.

Reviewed By: ldionne

Spies: EricWF, krytarowski, libcxx-commits

Differential Revision: https://reviews.llvm.org/D135824

NOKEYCHECK=True
GitOrigin-RevId: 627465cf9fa71ac1933986c20b32d6842a5b2678
diff --git a/include/string b/include/string
index 652fa32..8eb1d30 100644
--- a/include/string
+++ b/include/string
@@ -539,6 +539,7 @@
 #include <__format/enable_insertable.h>
 #include <__functional/hash.h>
 #include <__functional/unary_function.h>
+#include <__fwd/string.h>
 #include <__ios/fpos.h>
 #include <__iterator/distance.h>
 #include <__iterator/iterator_traits.h>
@@ -565,7 +566,6 @@
 #include <cstdio>  // EOF
 #include <cstdlib>
 #include <cstring>
-#include <iosfwd>
 #include <limits>
 #include <stdexcept>
 #include <string_view>
@@ -646,23 +646,10 @@
      !is_convertible<const _Tp&, const _CharT*>::value
     > {};
 
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
-typedef basic_string<char8_t> u8string;
-#endif
-typedef basic_string<char16_t> u16string;
-typedef basic_string<char32_t> u32string;
-
 struct __uninitialized_size_tag {};
 
 template<class _CharT, class _Traits, class _Allocator>
-class
-    _LIBCPP_TEMPLATE_VIS
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
-    _LIBCPP_PREFERRED_NAME(u8string)
-#endif
-    _LIBCPP_PREFERRED_NAME(u16string)
-    _LIBCPP_PREFERRED_NAME(u32string)
-    basic_string
+class basic_string
 {
 public:
     typedef basic_string                                 __self;
@@ -4674,20 +4661,6 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
-_LIBCPP_BEGIN_NAMESPACE_STD
-namespace pmr {
-template <class _CharT, class _TraitsT = std::char_traits<_CharT>>
-using basic_string = std::basic_string<_CharT, _TraitsT, polymorphic_allocator<_CharT>>;
-
-using string    = basic_string<char>;
-using u16string = basic_string<char16_t>;
-using u32string = basic_string<char32_t>;
-using wstring   = basic_string<wchar_t>;
-} // namespace pmr
-_LIBCPP_END_NAMESPACE_STD
-#endif
-
 _LIBCPP_POP_MACROS
 
 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20