cmake build error: use of deleted function
I'm trying to build CMake 3.18.2 (also tried 3.18.4) with GCC 6.1.0 on Scientific Linux release 6.10 but I get the following build issue:
/tmp/adamjs5/spack-stage/spack-stage-cmake-3.18.2-tfm7ay3flf2ikxikt6xugz2nj23v22d3/spack-src/Source/cmQtAutoMocUic.cxx: In instantiation of 'typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = {anonymous}::cmQtAutoMocUicT::JobCompileUicT; _Args = {const std::shared_ptr<{anonymous}::cmQtAutoMocUicT::MappingT>&, std::unique_ptr<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::default_delete<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<{anonymous}::cmQtAutoMocUicT::JobCompileUicT, std::default_delete<{anonymous}::cmQtAutoMocUicT::JobCompileUicT> >]':
/tmp/adamjs5/spack-stage/spack-stage-cmake-3.18.2-tfm7ay3flf2ikxikt6xugz2nj23v22d3/spack-src/Source/cmWorkerPool.h:216:38: required from 'bool cmWorkerPool::EmplaceJob(Args&& ...) [with T = {anonymous}::cmQtAutoMocUicT::JobCompileUicT; Args = {const std::shared_ptr<{anonymous}::cmQtAutoMocUicT::MappingT>&, std::unique_ptr<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::default_delete<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >}]'
/tmp/adamjs5/spack-stage/spack-stage-cmake-3.18.2-tfm7ay3flf2ikxikt6xugz2nj23v22d3/spack-src/Source/cmQtAutoMocUic.cxx:1851:78: required from here
/tmp/adamjs5/spack-stage/spack-stage-cmake-3.18.2-tfm7ay3flf2ikxikt6xugz2nj23v22d3/spack-src/Source/cmQtAutoMocUic.cxx:510:24: error: use of deleted function 'std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = std::__cxx11::basic_string<char>; _Dp = std::default_delete<std::__cxx11::basic_string<char> >]'
using JobCompileT::JobCompileT;
^~~~~~~~~~~
In file included from /sw/gcc-6.1.0/include/c++/6.1.0/memory:81:0,
from /tmp/adamjs5/spack-stage/spack-stage-cmake-3.18.2-tfm7ay3flf2ikxikt6xugz2nj23v22d3/spack-src/Utilities/std/cm/memory:9,
from /tmp/adamjs5/spack-stage/spack-stage-cmake-3.18.2-tfm7ay3flf2ikxikt6xugz2nj23v22d3/spack-src/Source/cmQtAutoMocUic.cxx:17:
/sw/gcc-6.1.0/include/c++/6.1.0/bits/unique_ptr.h:356:7: note: declared here
unique_ptr(const unique_ptr&) = delete;
^~~~~~~~~~
/sw/gcc-6.1.0/include/c++/6.1.0/bits/unique_ptr.h:787:30: note: synthesized method '{anonymous}::cmQtAutoMocUicT::JobCompileUicT::JobCompileUicT({anonymous}::cmQtAutoMocUicT::MappingHandleT, std::unique_ptr<std::__cxx11::basic_string<char> >)' first required here
{ return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 71%] Building CXX object Source/CMakeFiles/CMakeLib.dir/cmRST.cxx.o
/sw/gcc-6.1.0/include/c++/6.1.0/bits/unique_ptr.h:170:7: warning: 'std::unique_ptr<_Tp, _Dp>::unique_ptr(std::unique_ptr<_Tp, _Dp>::pointer) noexcept [with _Tp = {anonymous}::cmQtAutoMocUicT::JobCompileUicT; _Dp = std::default_delete<{anonymous}::cmQtAutoMocUicT::JobCompileUicT>]' used but never defined
unique_ptr(pointer __p) noexcept
^~~~~~~~~~
make[2]: *** [Source/CMakeFiles/CMakeLib.dir/cmQtAutoMocUic.cxx.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Source/CMakeFiles/CMakeLib.dir/all] Error 2
make: *** [all] Error 2
Full build log and build environment can be found at https://github.com/spack/spack/issues/19301. Any suggestions?
Edited by Adam J. Stewart