tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: g++/map vs. clang



On Wed, Mar 28, 2012 at 07:13:51PM -0700, Dennis Ferguson wrote:
> 
> On 28 Mar, 2012, at 14:10 , Thomas Klausner wrote:
> > Next error, while building boost-libs:
> > 
> > In file included from /usr/include/g++/map:59:
> > /usr/include/g++/bits/stl_tree.h:136:4: error: call to implicitly-deleted 
> > copy constructor of 'std::pair<const void *const, 
> > boost::detail::tss_data_node>'
> >          _M_value_field(std::forward<_Args>(__args)...) { }
> >          ^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> 
> Maybe this(?):
> 
>     http://clang.llvm.org/compatibility.html#deleted-special-func

So I came up with this diff, which will probably cost performance, but
makes boost-libs 1.49.0 compile and package with clang. I don't know
what the necessary copy constructor should look like, so I'd
appreciate a suggestion; or a comment if it's ok to commit the diff,
which basically just removes the following block:

      template<class _U1, class _U2>
        pair(pair<_U1, _U2>&& __p)
        : first(std::forward<_U1>(__p.first)),
          second(std::forward<_U2>(__p.second)) { }

      pair&
      operator=(pair&& __p)
      { 
        first = std::move(__p.first);
        second = std::move(__p.second);
        return *this;
      }

      template<class _U1, class _U2>
        pair&
        operator=(pair<_U1, _U2>&& __p)
        {
          first = std::move(__p.first);
          second = std::move(__p.second);
          return *this;
        }

in g++/bits/stl_pair.h.
 Thomas
--- usr/include/g++/bits/stl_pair.h     2012-04-08 18:43:34.000000000 +0200
+++ /home/wiz/stl_pair.h        2012-04-09 16:20:17.000000000 +0200
@@ -116,6 +116,7 @@
          second(__p.second) { }
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if 0
       template<class _U1, class _U2>
         pair(pair<_U1, _U2>&& __p)
        : first(std::forward<_U1>(__p.first)),
@@ -137,6 +138,7 @@
          second = std::move(__p.second);
          return *this;
        }
+#endif
 
       void
       swap(pair& __p)


Home | Main Index | Thread Index | Old Index