/in/foo.cc: In function 'void test(int, int*, int*)':
/in/foo.cc:56:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < v.size(); i++)
~~^~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/6/bits/c++allocator.h:33:0,
from /usr/include/c++/6/bits/allocator.h:46,
from /usr/include/c++/6/string:41,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/6/ext/new_allocator.h: In instantiation of 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = Complex; _Args = {Complex}; _Tp = Complex]':
/usr/include/c++/6/bits/alloc_traits.h:475:4: required from 'static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = Complex; _Args = {Complex}; _Tp = Complex; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<Complex>]'
/usr/include/c++/6/bits/vector.tcc:96:30: required from 'void std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {Complex}; _Tp = Complex; _Alloc = std::allocator<Complex>]'
/usr/include/c++/6/bits/stl_vector.h:933:9: required from 'void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = Complex; _Alloc = std::allocator<Complex>; std::vector<_Tp, _Alloc>::value_type = Complex]'
/in/foo.cc:53:36: required from here
/usr/include/c++/6/ext/new_allocator.h:120:4: error: invalid initialization of non-const reference of type 'Complex&' from an rvalue of type 'Complex'
{ ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/foo.cc:16:2: note: initializing argument 1 of 'Complex::Complex(Complex&)'
Complex (Complex &c)
^~~~~~~
In file included from /usr/include/c++/6/bits/nested_exception.h:40:0,
from /usr/include/c++/6/exception:173,
from /usr/include/c++/6/ios:39,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Complex*, std::vector<Complex> >; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/include/c++/6/bits/stl_algo.h:1882:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Complex*, std::vector<Complex> >; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
/usr/include/c++/6/bits/stl_algo.h:1968:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Complex*, std::vector<Complex> >; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
/usr/include/c++/6/bits/stl_algo.h:4707:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<Complex*, std::vector<Complex> >]'
/in/foo.cc:55:24: required from here
/usr/include/c++/6/bits/stl_algo.h:1847:11: error: invalid initialization of non-const reference of type 'Complex&' from an rvalue of type 'std::remove_reference<Complex&>::type {aka Complex}'
__val = _GLIBCXX_MOVE(*__i);
^
/in/foo.cc:16:2: note: initializing argument 1 of 'Complex::Complex(Complex&)'
Complex (Complex &c)
^~~~~~~
In file included from /usr/include/c++/6/bits/nested_exception.h:40:0,
from /usr/include/c++/6/exception:173,
from /usr/include/c++/6/ios:39,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_heap.h: In instantiation of 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Complex*, std::vector<Complex> >; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/include/c++/6/bits/stl_algo.h:1669:23: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Complex*, std::vector<Complex> >; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
/usr/include/c++/6/bits/stl_algo.h:1930:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Complex*, std::vector<Complex> >; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
/usr/include/c++/6/bits/stl_algo.h:1945:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Complex*, std::vector<Complex> >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
/usr/include/c++/6/bits/stl_algo.h:1965:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Complex*, std::vector<Complex> >; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
/usr/include/c++/6/bits/stl_algo.h:4707:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<Complex*, std::vector<Complex> >]'
/in/foo.cc:55:24: required from here
/usr/include/c++/6/bits/stl_heap.h:334:25: error: invalid initialization of non-const reference of type 'Complex&' from an rvalue of type 'std::remove_reference<Complex&>::type {aka Complex}'
_ValueType __value = _GLIBCXX_MOVE(*(__first + __parent));
^
/in/foo.cc:16:2: note: initializing argument 1 of 'Complex::Complex(Complex&)'
Complex (Complex &c)
^~~~~~~
In file included from /usr/include/c++/6/bits/stl_algo.h:61:0,
from /usr/include/c++/6/algorithm:62,
from /in/foo.cc:3:
/usr/include/c++/6/bits/stl_heap.h:335:22: error: invalid initialization of non-const reference of type 'Complex&' from an rvalue of type 'std::remove_reference<Complex&>::type {aka Complex}'
std::__adjust_heap(__first, __parent, __len, _GLIBCXX_MOVE(__value),
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__comp);
~~~~~~~
/in/foo.cc:16:2: note: initializing argument 1 of 'Complex::Complex(Complex&)'
Complex (Complex &c)
^~~~~~~
In file included from /usr/include/c++/6/bits/stl_algo.h:61:0,
from /usr/include/c++/6/algorithm:62,
from /in/foo.cc:3:
/usr/include/c++/6/bits/stl_heap.h:209:5: note: initializing argument 4 of 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Complex*, std::vector<Complex> >; _Distance = long int; _Tp = Complex; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
__adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
^~~~~~~~~~~~~
In file included from /usr/include/c++/6/bits/nested_exception.h:40:0,
from /usr/include/c++/6/exception:173,
from /usr/include/c++/6/ios:39,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_heap.h: In instantiation of 'void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Complex*, std::vector<Complex> >; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/include/c++/6/bits/stl_algo.h:1672:19: required from '