Fix more unreserved names

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304383 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/limits b/include/limits
index 675cfc4..f530507 100644
--- a/include/limits
+++ b/include/limits
@@ -183,14 +183,14 @@
     static _LIBCPP_CONSTEXPR const float_round_style round_style = round_toward_zero;
 };
 
-template <class _Tp, int digits, bool _IsSigned>
+template <class _Tp, int __digits, bool _IsSigned>
 struct __libcpp_compute_min
 {
-    static _LIBCPP_CONSTEXPR const _Tp value = _Tp(_Tp(1) << digits);
+    static _LIBCPP_CONSTEXPR const _Tp value = _Tp(_Tp(1) << __digits);
 };
 
-template <class _Tp, int digits>
-struct __libcpp_compute_min<_Tp, digits, false>
+template <class _Tp, int __digits>
+struct __libcpp_compute_min<_Tp, __digits, false>
 {
     static _LIBCPP_CONSTEXPR const _Tp value = _Tp(0);
 };
diff --git a/include/memory b/include/memory
index b12b46a..711551d 100644
--- a/include/memory
+++ b/include/memory
@@ -1543,7 +1543,7 @@
         {return __a.allocate(__n);}
     _LIBCPP_INLINE_VISIBILITY
     static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer __hint)
-        {return allocate(__a, __n, __hint,
+        {return __allocate(__a, __n, __hint,
             __has_allocate_hint<allocator_type, size_type, const_void_pointer>());}
 
     _LIBCPP_INLINE_VISIBILITY
@@ -1597,7 +1597,7 @@
     _LIBCPP_INLINE_VISIBILITY
     static allocator_type
         select_on_container_copy_construction(const allocator_type& __a)
-            {return select_on_container_copy_construction(
+            {return __select_on_container_copy_construction(
                 __has_select_on_container_copy_construction<const allocator_type>(),
                 __a);}
 
@@ -1696,11 +1696,11 @@
 private:
 
     _LIBCPP_INLINE_VISIBILITY
-    static pointer allocate(allocator_type& __a, size_type __n,
+    static pointer __allocate(allocator_type& __a, size_type __n,
         const_void_pointer __hint, true_type)
         {return __a.allocate(__n, __hint);}
     _LIBCPP_INLINE_VISIBILITY
-    static pointer allocate(allocator_type& __a, size_type __n,
+    static pointer __allocate(allocator_type& __a, size_type __n,
         const_void_pointer, false_type)
         {return __a.allocate(__n);}
 
@@ -1737,11 +1737,11 @@
 
     _LIBCPP_INLINE_VISIBILITY
     static allocator_type
-        select_on_container_copy_construction(true_type, const allocator_type& __a)
+        __select_on_container_copy_construction(true_type, const allocator_type& __a)
             {return __a.select_on_container_copy_construction();}
     _LIBCPP_INLINE_VISIBILITY
     static allocator_type
-        select_on_container_copy_construction(false_type, const allocator_type& __a)
+        __select_on_container_copy_construction(false_type, const allocator_type& __a)
             {return __a;}
 };
 
@@ -3103,28 +3103,28 @@
 struct __destruct_n
 {
 private:
-    size_t size;
+    size_t __size_;
 
     template <class _Tp>
     _LIBCPP_INLINE_VISIBILITY void __process(_Tp* __p, false_type) _NOEXCEPT
-        {for (size_t __i = 0; __i < size; ++__i, ++__p) __p->~_Tp();}
+        {for (size_t __i = 0; __i < __size_; ++__i, ++__p) __p->~_Tp();}
 
     template <class _Tp>
     _LIBCPP_INLINE_VISIBILITY void __process(_Tp*, true_type) _NOEXCEPT
         {}
 
     _LIBCPP_INLINE_VISIBILITY void __incr(false_type) _NOEXCEPT
-        {++size;}
+        {++__size_;}
     _LIBCPP_INLINE_VISIBILITY void __incr(true_type) _NOEXCEPT
         {}
 
     _LIBCPP_INLINE_VISIBILITY void __set(size_t __s, false_type) _NOEXCEPT
-        {size = __s;}
+        {__size_ = __s;}
     _LIBCPP_INLINE_VISIBILITY void __set(size_t, true_type) _NOEXCEPT
         {}
 public:
     _LIBCPP_INLINE_VISIBILITY explicit __destruct_n(size_t __s) _NOEXCEPT
-        : size(__s) {}
+        : __size_(__s) {}
 
     template <class _Tp>
     _LIBCPP_INLINE_VISIBILITY void __incr(_Tp*) _NOEXCEPT
diff --git a/include/stdexcept b/include/stdexcept
index d501d09..95a96cc 100644
--- a/include/stdexcept
+++ b/include/stdexcept
@@ -61,9 +61,9 @@
 
     bool __uses_refcount() const;
 public:
-    explicit __libcpp_refstring(const char* msg);
-    __libcpp_refstring(const __libcpp_refstring& s) _NOEXCEPT;
-    __libcpp_refstring& operator=(const __libcpp_refstring& s) _NOEXCEPT;
+    explicit __libcpp_refstring(const char* __msg);
+    __libcpp_refstring(const __libcpp_refstring& __s) _NOEXCEPT;
+    __libcpp_refstring& operator=(const __libcpp_refstring& __s) _NOEXCEPT;
     ~__libcpp_refstring();
 
     const char* c_str() const _NOEXCEPT {return __imp_;}
diff --git a/include/string b/include/string
index 91df914..accf1ce 100644
--- a/include/string
+++ b/include/string
@@ -901,7 +901,7 @@
     void resize(size_type __n, value_type __c);
     _LIBCPP_INLINE_VISIBILITY void resize(size_type __n) {resize(__n, value_type());}
 
-    void reserve(size_type res_arg = 0);
+    void reserve(size_type __res_arg = 0);
     _LIBCPP_INLINE_VISIBILITY
     void shrink_to_fit() _NOEXCEPT {reserve();}
     _LIBCPP_INLINE_VISIBILITY
@@ -987,9 +987,9 @@
     basic_string& assign(const basic_string& __str) { return *this = __str; }
 #ifndef _LIBCPP_CXX03_LANG
     _LIBCPP_INLINE_VISIBILITY
-    basic_string& assign(basic_string&& str)
+    basic_string& assign(basic_string&& __str)
         _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value))
-        {*this = _VSTD::move(str); return *this;}
+        {*this = _VSTD::move(__str); return *this;}
 #endif
     basic_string& assign(const basic_string& __str, size_type __pos, size_type __n=npos);
     template <class _Tp>
@@ -999,7 +999,7 @@
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
             basic_string&
         >::type
-                  assign(const _Tp & __t, size_type pos, size_type n=npos);
+                  assign(const _Tp & __t, size_type __pos, size_type __n=npos);
     basic_string& assign(const value_type* __s, size_type __n);
     basic_string& assign(const value_type* __s);
     basic_string& assign(size_type __n, value_type __c);
diff --git a/include/string_view b/include/string_view
index 75374d2..4c759ab 100644
--- a/include/string_view
+++ b/include/string_view
@@ -356,9 +356,9 @@
 
 	_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
 	int compare(                       size_type __pos1, size_type __n1, 
-				basic_string_view _sv, size_type __pos2, size_type __n2) const
+				basic_string_view __sv, size_type __pos2, size_type __n2) const
 	{
-		return substr(__pos1, __n1).compare(_sv.substr(__pos2, __n2));
+		return substr(__pos1, __n1).compare(__sv.substr(__pos2, __n2));
 	}
 
 	_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY