Boost C++ Libraries: Ticket #13472: Bad feature detection for nvcc and clang as a host compiler. https://svn.boost.org/trac10/ticket/13472 <p> Boost feature detection is wrong if the source is compiled with nvcc and clang as host compiler. </p> <p> For example, move semantics can't be used with c++11 enabled. </p> <pre class="wiki">#include &lt;utility&gt; #include &lt;boost/variant.hpp&gt; class TestClass { public: TestClass() = default; TestClass(const TestClass &amp;) = delete; TestClass(TestClass &amp;&amp;) = default; }; int main() { TestClass c1; boost::variant&lt;TestClass&gt; v{std::move(c1)}; return 0; } </pre><p> When compiled with (ubuntu 16.04, gcc 5.4, CUDA 9.1): </p> <pre class="wiki">nvcc temp.cu -o temp -ccbin=/usr/bin/gcc -std=c++11 </pre><p> everything works well, but </p> <pre class="wiki">nvcc temp.cu -o temp -ccbin=/usr/bin/clang-4.0 -std=c++11 </pre><p> fails with the following: </p> <pre class="wiki">/usr/include/boost/variant/detail/initializer.hpp(110): error: function "TestClass::TestClass(const TestClass &amp;)" temp.cu(10): here cannot be referenced -- it is a deleted function detected during: instantiation of "int boost::detail::variant::make_initializer_node::apply&lt;BaseIndexPair, Iterator&gt;::initializer_node::initialize(void *, boost::detail::variant::make_initializer_node::apply&lt;BaseIndexPair, Iterator&gt;::initializer_node::param_T) [with BaseIndexPair=boost::mpl::pair&lt;boost::detail::variant::initializer_root, mpl_::int_&lt;0&gt;&gt;, Iterator=boost::mpl::l_iter&lt;boost::mpl::list1&lt;TestClass&gt;&gt;]" /usr/include/boost/variant/variant.hpp(1538): here instantiation of "void boost::variant&lt;T0_, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19&gt;::convert_construct(T &amp;, int, mpl_::false_) [with T0_=TestClass, T1=boost::detail::variant::void_, T2=boost::detail::variant::void_, T3=boost::detail::variant::void_, T4=boost::detail::variant::void_, T5=boost::detail::variant::void_, T6=boost::detail::variant::void_, T7=boost::detail::variant::void_, T8=boost::detail::variant::void_, T9=boost::detail::variant::void_, T10=boost::detail::variant::void_, T11=boost::detail::variant::void_, T12=boost::detail::variant::void_, T13=boost::detail::variant::void_, T14=boost::detail::variant::void_, T15=boost::detail::variant::void_, T16=boost::detail::variant::void_, T17=boost::detail::variant::void_, T18=boost::detail::variant::void_, T19=boost::detail::variant::void_, T=const TestClass]" /usr/include/boost/variant/variant.hpp(1683): here instantiation of "boost::variant&lt;T0_, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19&gt;::variant(const T &amp;) [with T0_=TestClass, T1=boost::detail::variant::void_, T2=boost::detail::variant::void_, T3=boost::detail::variant::void_, T4=boost::detail::variant::void_, T5=boost::detail::variant::void_, T6=boost::detail::variant::void_, T7=boost::detail::variant::void_, T8=boost::detail::variant::void_, T9=boost::detail::variant::void_, T10=boost::detail::variant::void_, T11=boost::detail::variant::void_, T12=boost::detail::variant::void_, T13=boost::detail::variant::void_, T14=boost::detail::variant::void_, T15=boost::detail::variant::void_, T16=boost::detail::variant::void_, T17=boost::detail::variant::void_, T18=boost::detail::variant::void_, T19=boost::detail::variant::void_, T=TestClass]" temp.cu(17): here 1 error detected in the compilation of "/tmp/tmpxft_00005819_00000000-8_temp.cpp1.ii". </pre><p> If I change <code>boost/config/select_compiler_config.hpp</code> </p> <pre class="wiki">42 #elif defined __clang__ &amp;&amp; !defined(__CUDACC__) </pre><p> to </p> <pre class="wiki">42 #elif defined __clang__ </pre><p> everything works well. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13472 Trac 1.4.3 John Maddock Tue, 31 Jul 2018 19:00:55 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/13472#comment:1 https://svn.boost.org/trac10/ticket/13472#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">obsolete</span> </li> </ul> <p> I'm pretty sure the &amp;&amp; !defined(<span class="underline">CUDACC</span>) is quite deliberate, and removing it will break other things... </p> <p> Moving the issue to <a class="ext-link" href="https://github.com/boostorg/config/issues/237"><span class="icon">​</span>https://github.com/boostorg/config/issues/237</a> </p> Ticket