Boost C++ Libraries: Ticket #11934: Various warnings in 1.60 MPL when compiling with nvcc https://svn.boost.org/trac10/ticket/11934 <p> I'm compiling a larger project ( <a class="ext-link" href="https://github.com/ComputationalRadiationPhysics/picongpu/"><span class="icon">​</span>https://github.com/ComputationalRadiationPhysics/picongpu/</a> current dev) which uses boost heavily. However a lot of warnings are issued. Since we are quite agnostic to warnings (compiling with many warnings enabled and -Werror) this is troubling and it would be great, if those are fixed in future versions. If I remember correctly older versions (1.58) did not had them. </p> <p> CUDA 7.0 </p> <pre class="wiki">boost/mpl/map/aux_/item.hpp(54): warning: "boost::mpl::aux::type_wrapper&lt;T&gt; operator/(const boost::mpl::m_item&lt;Key, T, Base&gt; &amp;, boost::mpl::aux::type_wrapper&lt;Key&gt; *)" declares a non-template function -- add &lt;&gt; to refer to a template instance boost/mpl/map/aux_/item.hpp(55): warning: "boost::mpl::aux::type_wrapper&lt;boost::mpl::pair&lt;Key, T&gt;&gt; operator|(const boost::mpl::m_item&lt;Key, T, Base&gt; &amp;, boost::mpl::next&lt;Base::order&gt;::type *)" declares a non-template function -- add &lt;&gt; to refer to a template instance boost/mpl/map/aux_/item.hpp(56): warning: "char (&amp;operator||(const boost::mpl::m_item&lt;Key, T, Base&gt; &amp;, boost::mpl::aux::type_wrapper&lt;Key&gt; *))[boost::mpl::next&lt;Base::order&gt;::type::value]" declares a non-template function -- add &lt;&gt; to refer to a template instance boost/mpl/map/aux_/item.hpp(71): warning: "boost::mpl::aux::type_wrapper&lt;mpl_::void_&gt; operator/(const boost::mpl::m_mask&lt;Key, Base&gt; &amp;, boost::mpl::aux::type_wrapper&lt;Key&gt; *)" declares a non-template function -- add &lt;&gt; to refer to a template instance boost/mpl/map/aux_/item.hpp(72): warning: "boost::mpl::aux::type_wrapper&lt;mpl_::void_&gt; operator|(const boost::mpl::m_mask&lt;Key, Base&gt; &amp;, boost::mpl::x_order_impl&lt;Base, Key&gt;::type *)" declares a non-template function -- add &lt;&gt; to refer to a template instance boost/mpl/map/aux_/item.hpp:54:109: warning: friend declaration ‘boost::mpl::aux::type_wrapper&lt;Key&gt; boost::mpl::operator/(const boost::mpl::m_item&lt;Key, T, Base&gt;&amp;, boost::mpl::aux::type_wrapper&lt;T&gt;*)’ declares a non-template function [-Wnon-template-friend] BOOST_MPL_AUX_MAP_OVERLOAD( aux::type_wrapper&lt;T&gt;, VALUE_BY_KEY, m_item, aux::type_wrapper&lt;Key&gt;* ); ^ boost/mpl/map/aux_/item.hpp:54:109: note: (if this is not what you intended, make sure the function template has already been declared and add &lt;&gt; after the function name here) boost/mpl/map/aux_/item.hpp:55:90: warning: friend declaration ‘boost::mpl::aux::type_wrapper&lt;boost::mpl::pair&lt;T1, T2&gt; &gt; boost::mpl::operator|(const boost::mpl::m_item&lt;Key, T, Base&gt;&amp;, boost::mpl::m_item&lt;Key, T, Base&gt;::order*)’ declares a non-template function [-Wnon-template-friend] BOOST_MPL_AUX_MAP_OVERLOAD( aux::type_wrapper&lt;item&gt;, ITEM_BY_ORDER, m_item, order* ); ^ boost/mpl/map/aux_/item.hpp:56:85: warning: friend declaration ‘char (&amp; boost::mpl::operator||(const boost::mpl::m_item&lt;Key, T, Base&gt;&amp;, boost::mpl::aux::type_wrapper&lt;T&gt;*))[boost::mpl::m_item&lt;Key, T, Base&gt;::order:: value]’ declares a non-template function [-Wnon-template-friend] BOOST_MPL_AUX_MAP_OVERLOAD( order_tag_, ORDER_BY_KEY, m_item, aux::type_wrapper&lt;Key&gt;* ); ^ boost/mpl/map/aux_/item.hpp:71:121: warning: friend declaration ‘boost::mpl::aux::type_wrapper&lt;mpl_::void_&gt; boost::mpl::operator/(const boost::mpl::m_mask&lt;Key, Base&gt;&amp;, boost::mpl::aux::type_wrapper&lt;T&gt;*)’ declares a non-template function [-Wnon-template-friend] BOOST_MPL_AUX_MAP_OVERLOAD( aux::type_wrapper&lt;void_&gt;, VALUE_BY_KEY, m_mask, aux::type_wrapper&lt;Key&gt;* ); ^ boost/mpl/map/aux_/item.hpp:72:94: warning: friend declaration ‘boost::mpl::aux::type_wrapper&lt;mpl_::void_&gt; boost::mpl::operator|(const boost::mpl::m_mask&lt;Key, Base&gt;&amp;, boost::mpl::m_mask&lt;Key, Base&gt;::key_order_*)’ declares a non-template function [-Wnon-template-friend] BOOST_MPL_AUX_MAP_OVERLOAD( aux::type_wrapper&lt;void_&gt;, ITEM_BY_ORDER, m_mask, key_order_* ); </pre><p> CUDA 7.5 </p> <pre class="wiki">boost/mpl/map/aux_/item.hpp(54): warning: "boost::mpl::aux::type_wrapper&lt;T&gt; operator/(const boost::mpl::m_item&lt;Key, T, Base&gt; &amp;, boost::mpl::aux::type_wrapper&lt;Key&gt; *)" declares a non-template function -- add &lt;&gt; to refer to a template instance boost/mpl/map/aux_/item.hpp(55): warning: "boost::mpl::aux::type_wrapper&lt;boost::mpl::pair&lt;Key, T&gt;&gt; operator|(const boost::mpl::m_item&lt;Key, T, Base&gt; &amp;, boost::mpl::next&lt;Base::order&gt;::type *)" declares a non-template function -- add &lt;&gt; to refer to a template instance boost/mpl/map/aux_/item.hpp(56): warning: "char (&amp;operator||(const boost::mpl::m_item&lt;Key, T, Base&gt; &amp;, boost::mpl::aux::type_wrapper&lt;Key&gt; *))[boost::mpl::next&lt;Base::order&gt;::type::value]" declares a non-template function -- add &lt;&gt; to refer to a template instance boost/mpl/map/aux_/item.hpp(71): warning: "boost::mpl::aux::type_wrapper&lt;mpl_::void_&gt; operator/(const boost::mpl::m_mask&lt;Key, Base&gt; &amp;, boost::mpl::aux::type_wrapper&lt;Key&gt; *)" declares a non-template function -- add &lt;&gt; to refer to a template instance boost/mpl/map/aux_/item.hpp(72): warning: "boost::mpl::aux::type_wrapper&lt;mpl_::void_&gt; operator|(const boost::mpl::m_mask&lt;Key, Base&gt; &amp;, boost::mpl::x_order_impl&lt;Base, Key&gt;::type *)" declares a non-template function -- add &lt;&gt; to refer to a template instance boost/mpl/map/aux_/item.hpp:54:109: warning: friend declaration ‘boost::mpl::aux::type_wrapper&lt;Key&gt; boost::mpl::operator/(const boost::mpl::m_item&lt;Key, T, Base&gt;&amp;, boost::mpl::aux::type_wrapper&lt;T&gt;*)’ declares a non-template function [-Wnon-template-friend] BOOST_MPL_AUX_MAP_OVERLOAD( aux::type_wrapper&lt;T&gt;, VALUE_BY_KEY, m_item, aux::type_wrapper&lt;Key&gt;* ); ^ boost/mpl/map/aux_/item.hpp:54:109: note: (if this is not what you intended, make sure the function template has already been declared and add &lt;&gt; after the function name here) boost/mpl/map/aux_/item.hpp:55:90: warning: friend declaration ‘boost::mpl::aux::type_wrapper&lt;boost::mpl::pair&lt;T1, T2&gt; &gt; boost::mpl::operator|(const boost::mpl::m_item&lt;Key, T, Base&gt;&amp;, boost::mpl::m_item&lt;Key, T, Base&gt;::order*)’ declares a non-template function [-Wnon-template-friend] BOOST_MPL_AUX_MAP_OVERLOAD( aux::type_wrapper&lt;item&gt;, ITEM_BY_ORDER, m_item, order* ); ^ boost/mpl/map/aux_/item.hpp:56:85: warning: friend declaration ‘char (&amp; boost::mpl::operator||(const boost::mpl::m_item&lt;Key, T, Base&gt;&amp;, boost::mpl::aux::type_wrapper&lt;T&gt;*))[boost::mpl::m_item&lt;Key, T, Base&gt;::order:: value]’ declares a non-template function [-Wnon-template-friend] BOOST_MPL_AUX_MAP_OVERLOAD( order_tag_, ORDER_BY_KEY, m_item, aux::type_wrapper&lt;Key&gt;* ); ^ boost/mpl/map/aux_/item.hpp:71:121: warning: friend declaration ‘boost::mpl::aux::type_wrapper&lt;mpl_::void_&gt; boost::mpl::operator/(const boost::mpl::m_mask&lt;Key, Base&gt;&amp;, boost::mpl::aux::type_wrapper&lt;T&gt;*)’ declares a non-template function [-Wnon-template-friend] BOOST_MPL_AUX_MAP_OVERLOAD( aux::type_wrapper&lt;void_&gt;, VALUE_BY_KEY, m_mask, aux::type_wrapper&lt;Key&gt;* ); ^ boost/mpl/map/aux_/item.hpp:72:94: warning: friend declaration ‘boost::mpl::aux::type_wrapper&lt;mpl_::void_&gt; boost::mpl::operator|(const boost::mpl::m_mask&lt;Key, Base&gt;&amp;, boost::mpl::m_mask&lt;Key, Base&gt;::key_order_*)’ declares a non-template function [-Wnon-template-friend] BOOST_MPL_AUX_MAP_OVERLOAD( aux::type_wrapper&lt;void_&gt;, ITEM_BY_ORDER, m_mask, key_order_* ); </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11934 Trac 1.4.3 k.ljunngkvist@… Sat, 19 Mar 2016 01:41:17 GMT <link>https://svn.boost.org/trac10/ticket/11934#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11934#comment:1</guid> <description> <p> I also experience this, also in the context of compiling with the CUDA nvcc compiler. Note that it appears both when compiling CUDA code (i.e. .cu files), and regular pure c++ files. In my case I am using boost 1.56. </p> </description> <category>Ticket</category> </item> <item> <author>Alexander Korsunsky <a.korsunsky@…></author> <pubDate>Tue, 24 Oct 2017 16:19:51 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11934#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11934#comment:2</guid> <description> <p> This is still a problem with NVCC from CUDA 9.0 and with Boost 1.65.1. </p> <p> Sadly, even adding <code>-Xcompiler -Wno-non-template-friend</code> to the nvcc command line does not help </p> </description> <category>Ticket</category> </item> <item> <author>emmanuel.delor@…</author> <pubDate>Tue, 13 Feb 2018 16:38:39 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11934#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11934#comment:3</guid> <description> <p> I have the same issue. The severity may be more than cosmetic, getting thousands of warnings is bad. </p> </description> <category>Ticket</category> </item> </channel> </rss>