Hi Jonathan,

>> Yes, this is fine in principle. Please update the docs and change
>> _Mt to _Cmp2 though.
> 
> Sure, will adjust, test and follow up.

Revised patch attached. Bootstrapped and regression tests
fine on x86_64-linux.

2020-01-09  Olivier Hainque  <hain...@adacore.com>

        libstdc++-v3/
        * doc/xml/manual/appendix_contributing.xml: Document _C2
        as a reserved identifier, by VxWorks.
        * include/bits/stl_map.h: Rename _C2 template typenames as _Cmp2.
        * include/bits/stl_multimap.h: Likewise.

diff --git a/libstdc++-v3/doc/xml/manual/appendix_contributing.xml 
b/libstdc++-v3/doc/xml/manual/appendix_contributing.xml
index 3e10e1b5e5c..b399e71d482 100644
--- a/libstdc++-v3/doc/xml/manual/appendix_contributing.xml
+++ b/libstdc++-v3/doc/xml/manual/appendix_contributing.xml
@@ -463,6 +463,9 @@ indicate a place that may require attention for 
multi-thread safety.
       _res_ext
       __tg_*
 
+      VxWorks adds:
+      _C2
+
       For GCC:
 
       [Note that this list is out of date. It applies to the old
diff --git a/libstdc++-v3/include/bits/stl_map.h 
b/libstdc++-v3/include/bits/stl_map.h
index 4e4b82f5217..fe930c15757 100644
--- a/libstdc++-v3/include/bits/stl_map.h
+++ b/libstdc++-v3/include/bits/stl_map.h
@@ -637,30 +637,30 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       template<typename, typename>
        friend class std::_Rb_tree_merge_helper;
 
-      template<typename _C2>
+      template<typename _Cmp2>
        void
-       merge(map<_Key, _Tp, _C2, _Alloc>& __source)
+       merge(map<_Key, _Tp, _Cmp2, _Alloc>& __source)
        {
-         using _Merge_helper = _Rb_tree_merge_helper<map, _C2>;
+         using _Merge_helper = _Rb_tree_merge_helper<map, _Cmp2>;
          _M_t._M_merge_unique(_Merge_helper::_S_get_tree(__source));
        }
 
-      template<typename _C2>
+      template<typename _Cmp2>
        void
-       merge(map<_Key, _Tp, _C2, _Alloc>&& __source)
+       merge(map<_Key, _Tp, _Cmp2, _Alloc>&& __source)
        { merge(__source); }
 
-      template<typename _C2>
+      template<typename _Cmp2>
        void
-       merge(multimap<_Key, _Tp, _C2, _Alloc>& __source)
+       merge(multimap<_Key, _Tp, _Cmp2, _Alloc>& __source)
        {
-         using _Merge_helper = _Rb_tree_merge_helper<map, _C2>;
+         using _Merge_helper = _Rb_tree_merge_helper<map, _Cmp2>;
          _M_t._M_merge_unique(_Merge_helper::_S_get_tree(__source));
        }
 
-      template<typename _C2>
+      template<typename _Cmp2>
        void
-       merge(multimap<_Key, _Tp, _C2, _Alloc>&& __source)
+       merge(multimap<_Key, _Tp, _Cmp2, _Alloc>&& __source)
        { merge(__source); }
 #endif // C++17
 
diff --git a/libstdc++-v3/include/bits/stl_multimap.h 
b/libstdc++-v3/include/bits/stl_multimap.h
index 48f57788798..d38f530e123 100644
--- a/libstdc++-v3/include/bits/stl_multimap.h
+++ b/libstdc++-v3/include/bits/stl_multimap.h
@@ -653,30 +653,30 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       template<typename, typename>
        friend class std::_Rb_tree_merge_helper;
 
-      template<typename _C2>
+      template<typename _Cmp2>
        void
-       merge(multimap<_Key, _Tp, _C2, _Alloc>& __source)
+       merge(multimap<_Key, _Tp, _Cmp2, _Alloc>& __source)
        {
-         using _Merge_helper = _Rb_tree_merge_helper<multimap, _C2>;
+         using _Merge_helper = _Rb_tree_merge_helper<multimap, _Cmp2>;
          _M_t._M_merge_equal(_Merge_helper::_S_get_tree(__source));
        }
 
-      template<typename _C2>
+      template<typename _Cmp2>
        void
-       merge(multimap<_Key, _Tp, _C2, _Alloc>&& __source)
+       merge(multimap<_Key, _Tp, _Cmp2, _Alloc>&& __source)
        { merge(__source); }
 
-      template<typename _C2>
+      template<typename _Cmp2>
        void
-       merge(map<_Key, _Tp, _C2, _Alloc>& __source)
+       merge(map<_Key, _Tp, _Cmp2, _Alloc>& __source)
        {
-         using _Merge_helper = _Rb_tree_merge_helper<multimap, _C2>;
+         using _Merge_helper = _Rb_tree_merge_helper<multimap, _Cmp2>;
          _M_t._M_merge_equal(_Merge_helper::_S_get_tree(__source));
        }
 
-      template<typename _C2>
+      template<typename _Cmp2>
        void
-       merge(map<_Key, _Tp, _C2, _Alloc>&& __source)
+       merge(map<_Key, _Tp, _Cmp2, _Alloc>&& __source)
        { merge(__source); }
 #endif // C++17
 

Reply via email to