Opened 8 years ago

Closed 8 years ago

#755 closed bug (fixed)

Error building with GCC 6 (C++14)

Reported by: loganjerry@… Owned by: somebody
Priority: minor Milestone: 4-1-0 and higher
Component: dontKnow Version: 4-0-3
Keywords: Cc:


Fedora has started building with the upcoming GCC 6 compiler, which defaults to C++14 mode when building C++ code. It encounters an error while building Singular 4-0-3: In function 'bool ppreduceInitially(sip_sideal*&, number, ideal, ring)': error: no matching function for call to 'make_pair(int&, int)'
In file included from /usr/include/c++/6.0.0/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/6.0.0/vector:60,
                 from ../../../gfanlib/gfanlib_vector.h:11,
                 from ./tropicalStrategy.h:4,
                 from ppinitialReduction.h:5,
/usr/include/c++/6.0.0/bits/stl_pair.h:406:5: note: candidate: template<class _T1, class _T2> constexpr std::pair<typename std::__decay_and_strip<_Tp>::__type, typename std::__decay_and_strip<_T2>::__type> std::make_pair(_T1&&, _T2&&)
     make_pair(_T1&& __x, _T2&& __y)
/usr/include/c++/6.0.0/bits/stl_pair.h:406:5: note:   template argument deduction/substitution failed: note:   cannot convert 'i' (type 'int') to type 'int&&'

The solution is to let the compiler deduce the types; i.e. change that line to this:


This should work for earlier versions of GCC as well. The point of make_pair is that you don't have to specify the types.

Change History (1)

comment:1 Changed 8 years ago by hannes

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.