Cleanup: move visibility/linkage attributes to the first declaration.

http://reviews.llvm.org/D15404

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267093 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/forward_list b/include/forward_list
index 78bcc55..18b300d 100644
--- a/include/forward_list
+++ b/include/forward_list
@@ -480,8 +480,10 @@
 
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 public:
+    _LIBCPP_INLINE_VISIBILITY
     __forward_list_base(__forward_list_base&& __x)
         _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value);
+    _LIBCPP_INLINE_VISIBILITY
     __forward_list_base(__forward_list_base&& __x, const allocator_type& __a);
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
@@ -506,6 +508,7 @@
               __node_traits::propagate_on_container_move_assignment::value>());}
 
 public:
+    _LIBCPP_INLINE_VISIBILITY
     void swap(__forward_list_base& __x)
 #if _LIBCPP_STD_VER >= 14
         _NOEXCEPT;
@@ -539,7 +542,7 @@
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
 __forward_list_base<_Tp, _Alloc>::__forward_list_base(__forward_list_base&& __x)
         _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value)
     : __before_begin_(_VSTD::move(__x.__before_begin_))
@@ -548,7 +551,7 @@
 }
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
 __forward_list_base<_Tp, _Alloc>::__forward_list_base(__forward_list_base&& __x,
                                                       const allocator_type& __a)
     : __before_begin_(__begin_node(), __node_allocator(__a))
@@ -569,7 +572,7 @@
 }
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
 void
 __forward_list_base<_Tp, _Alloc>::swap(__forward_list_base& __x)
 #if _LIBCPP_STD_VER >= 14
@@ -632,6 +635,7 @@
     forward_list()
         _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value)
         {} // = default;
+    _LIBCPP_INLINE_VISIBILITY
     explicit forward_list(const allocator_type& __a);
     explicit forward_list(size_type __n);
 #if _LIBCPP_STD_VER > 11
@@ -668,12 +672,14 @@
 
     forward_list& operator=(const forward_list& __x);
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
     forward_list& operator=(forward_list&& __x)
         _NOEXCEPT_(
              __node_traits::propagate_on_container_move_assignment::value &&
              is_nothrow_move_assignable<allocator_type>::value);
 #endif
 #ifndef  _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    _LIBCPP_INLINE_VISIBILITY
     forward_list& operator=(initializer_list<value_type> __il);
 #endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
@@ -686,6 +692,7 @@
         assign(_InputIterator __f, _InputIterator __l);
     void assign(size_type __n, const value_type& __v);
 #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    _LIBCPP_INLINE_VISIBILITY
     void assign(initializer_list<value_type> __il);
 #endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
@@ -816,7 +823,7 @@
     template <class _Compare> void merge(forward_list& __x, _Compare __comp);
     _LIBCPP_INLINE_VISIBILITY
     void sort() {sort(__less<value_type>());}
-    template <class _Compare> void sort(_Compare __comp);
+    template <class _Compare> _LIBCPP_INLINE_VISIBILITY void sort(_Compare __comp);
     void reverse() _NOEXCEPT;
 
 private:
@@ -839,7 +846,7 @@
 };
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
 forward_list<_Tp, _Alloc>::forward_list(const allocator_type& __a)
     : base(__a)
 {
@@ -1013,7 +1020,7 @@
 }
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
 forward_list<_Tp, _Alloc>&
 forward_list<_Tp, _Alloc>::operator=(forward_list&& __x)
     _NOEXCEPT_(
@@ -1030,7 +1037,7 @@
 #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
 forward_list<_Tp, _Alloc>&
 forward_list<_Tp, _Alloc>::operator=(initializer_list<value_type> __il)
 {
@@ -1078,7 +1085,7 @@
 #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
 void
 forward_list<_Tp, _Alloc>::assign(initializer_list<value_type> __il)
 {
@@ -1602,7 +1609,7 @@
 
 template <class _Tp, class _Alloc>
 template <class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
 void
 forward_list<_Tp, _Alloc>::sort(_Compare __comp)
 {