[xsd-users] xsd-3.3.0-gcc-4.7-clang.patch

Juan Carlos Rueda Quezada jcrq51 at hotmail.com
Thu Jul 3 16:39:29 EDT 2014


Hi,
I applied the patch on mac osx and my program built successfully, but i tried to do the same on Linux CentOs 6.3 without success.
When i try to build  the examples with clang++ and the option -std=c++11 , i get a lot warnings and errors:
          ^In file included from main.cpp:31:In file included from /usr/local/include/libxsd/xsd/cxx/tree/elements.hxx:20:In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/map:60:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_tree.h:136:4: error: call to implicitly-deleted copy constructor of 'std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *>'          _M_value_field(std::forward<_Args>(__args)...) { }          ^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/ext/new_allocator.h:111:23: note: in instantiation of function template specialization 'std::_Rb_tree_node<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> >::_Rb_tree_node<const std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> &>' requested here        { ::new((void *)__p) _Tp(std::forward<_Args>(__args)...); }                             ^/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_tree.h:394:32: note: in instantiation of function template specialization '__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> > >::construct<const std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> &>' requested here              _M_get_Node_allocator().construct(__tmp,                                      ^/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_tree.h:881:24: note: in instantiation of function template specialization 'std::_Rb_tree<const xsd::cxx::tree::identity *, std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *>, std::_Select1st<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> >, xsd::cxx::tree::_type::identity_comparator, std::allocator<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> > >::_M_create_node<const std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> &>' requested here      _Link_type __z = _M_create_node(__v);                       ^/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_tree.h:1215:13: note: in instantiation of member function 'std::_Rb_tree<const xsd::cxx::tree::identity *, std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *>, std::_Select1st<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> >, xsd::cxx::tree::_type::identity_comparator, std::allocator<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> > >::_M_insert_' requested here            return _M_insert_(0, _M_rightmost(), __v);                   ^/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_tree.h:1324:4: note: in instantiation of member function 'std::_Rb_tree<const xsd::cxx::tree::identity *, std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *>, std::_Select1st<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> >, xsd::cxx::tree::_type::identity_comparator, std::allocator<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> > >::_M_insert_unique_' requested here          _M_insert_unique_(end(), *__first);          ^/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_map.h:553:16: note: in instantiation of function template specialization 'std::_Rb_tree<const xsd::cxx::tree::identity *, std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *>, std::_Select1st<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> >, xsd::cxx::tree::_type::identity_comparator, std::allocator<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> > >::_M_insert_unique<std::_Rb_tree_iterator<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> > >' requested here        { _M_t._M_insert_unique(__first, __last); }               ^/usr/local/include/libxsd/xsd/cxx/tree/elements.hxx:442:20: note: in instantiation of function template specialization 'std::map<const xsd::cxx::tree::identity *, xsd::cxx::tree::_type *, xsd::cxx::tree::_type::identity_comparator, std::allocator<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> > >::insert<std::_Rb_tree_iterator<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> > >' requested here                m->insert (map_->begin (), map_->end ());                   ^/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_pair.h:92:7: note: copy constructor is implicitly deleted because 'pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *>' has a user-declared move constructor      pair(pair&& __p)      ^/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_pair.h:89:10: error: no matching function for call to 'forward'        : first(std::forward<_U1>(__x)),                ^~~~~~~~~~~~~~~~~/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_tree.h:1177:13: note: in instantiation of function template specialization 'std::pair<std::_Rb_tree_iterator<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> >, bool>::pair<std::_Rb_tree_iterator<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> >, bool>' requested here            return pair<iterator, bool>(_M_insert_(__x, __y, __v), true);                   ^/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_tree.h:1217:13: note: in instantiation of member function 'std::_Rb_tree<const xsd::cxx::tree::identity *, std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *>, std::_Select1st<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> >, xsd::cxx::tree::_type::identity_comparator, std::allocator<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> > >::_M_insert_unique' requested here            return _M_insert_unique(__v).first;                   ^/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_tree.h:1324:4: note: in instantiation of member function 'std::_Rb_tree<const xsd::cxx::tree::identity *, std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *>, std::_Select1st<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> >, xsd::cxx::tree::_type::identity_comparator, std::allocator<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> > >::_M_insert_unique_' requested here          _M_insert_unique_(end(), *__first);          ^/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_map.h:553:16: note: in instantiation of function template specialization 'std::_Rb_tree<const xsd::cxx::tree::identity *, std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *>, std::_Select1st<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> >, xsd::cxx::tree::_type::identity_comparator, std::allocator<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> > >::_M_insert_unique<std::_Rb_tree_iterator<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> > >' requested here        { _M_t._M_insert_unique(__first, __last); }               ^/usr/local/include/libxsd/xsd/cxx/tree/elements.hxx:442:20: note: in instantiation of function template specialization 'std::map<const xsd::cxx::tree::identity *, xsd::cxx::tree::_type *, xsd::cxx::tree::_type::identity_comparator, std::allocator<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> > >::insert<std::_Rb_tree_iterator<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> > >' requested here                m->insert (map_->begin (), map_->end ());                   ^/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/move.h:51:5: note: candidate function [with _Tp = std::_Rb_tree_iterator<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> >] not viable: no known conversion from 'std::_Rb_tree_iterator<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> >' to 'typename std::identity<_Rb_tree_iterator<pair<const identity *const, _type *> > >::type &&' (aka 'std::_Rb_tree_iterator<std::pair<const xsd::cxx::tree::identity *const, xsd::cxx::tree::_type *> > &&') for 1st argument    forward(typename std::identity<_Tp>::type&& __t)

I am building following this steps:
1. Modify the compilers.make file
$ cd /apps/Dev/xsd-3.3.0-x86_64-linux-gnu/examples/build/cxx/
$ vi compilers.make
# file      : examples/build/cxx/compilers.make# author    : Boris Kolpackov <boris at codesynthesis.com># copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC# license   : GNU GPL v2 + exceptions; see accompanying LICENSE file
CXX := clang++
3.  $ cd /apps/Dev/xsd-3.3.0-x86_64-linux-gnu/examples/cxx/tree/hello4. $ make clean5. $ make


Could you help me.
my setup is:
Operating system:CentOS 6.3Linux 2.6.32-279.el6.x86_64 x86_64


Clang compiler:
clang version 3.5.0 (trunk 212189) (llvm/trunk 212188)Target: x86_64-unknown-linux-gnuThread model: posix
GNU compiler:
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)Copyright (C) 2010 Free Software Foundation, Inc.


 		 	   		  


More information about the xsd-users mailing list