Opened 7 years ago

Last modified 5 years ago

#11934 new Bugs

Various warnings in 1.60 MPL when compiling with nvcc

Reported by: Alex Grund <a.grund@…> Owned by: Aleksey Gurtovoy
Milestone: To Be Determined Component: mpl
Version: Boost 1.60.0 Severity: Cosmetic
Keywords: Cc:

Description

I'm compiling a larger project ( https://github.com/ComputationalRadiationPhysics/picongpu/ 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.

CUDA 7.0

boost/mpl/map/aux_/item.hpp(54): warning: "boost::mpl::aux::type_wrapper<T> operator/(const boost::mpl::m_item<Key, T, Base> &, boost::mpl::aux::type_wrapper<Key> *)" declares a non-template function -- add <> to refer to a template instance

boost/mpl/map/aux_/item.hpp(55): warning: "boost::mpl::aux::type_wrapper<boost::mpl::pair<Key, T>> operator|(const boost::mpl::m_item<Key, T, Base> &, boost::mpl::next<Base::order>::type *)" declares a non-template function -- add <> to refer to a template instance

boost/mpl/map/aux_/item.hpp(56): warning: "char (&operator||(const boost::mpl::m_item<Key, T, Base> &, boost::mpl::aux::type_wrapper<Key> *))[boost::mpl::next<Base::order>::type::value]" declares a non-template function -- add <> to refer to a template instance

boost/mpl/map/aux_/item.hpp(71): warning: "boost::mpl::aux::type_wrapper<mpl_::void_> operator/(const boost::mpl::m_mask<Key, Base> &, boost::mpl::aux::type_wrapper<Key> *)" declares a non-template function -- add <> to refer to a template instance

boost/mpl/map/aux_/item.hpp(72): warning: "boost::mpl::aux::type_wrapper<mpl_::void_> operator|(const boost::mpl::m_mask<Key, Base> &, boost::mpl::x_order_impl<Base, Key>::type *)" declares a non-template function -- add <> to refer to a template instance

boost/mpl/map/aux_/item.hpp:54:109: warning: friend declaration ‘boost::mpl::aux::type_wrapper<Key> boost::mpl::operator/(const boost::mpl::m_item<Key, T, Base>&, boost::mpl::aux::type_wrapper<T>*)’ declares a non-template function [-Wnon-template-friend]
     BOOST_MPL_AUX_MAP_OVERLOAD( aux::type_wrapper<T>, VALUE_BY_KEY, m_item, aux::type_wrapper<Key>* );
                                                                                                             ^
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 <> after the function name here) 
boost/mpl/map/aux_/item.hpp:55:90: warning: friend declaration ‘boost::mpl::aux::type_wrapper<boost::mpl::pair<T1, T2> > boost::mpl::operator|(const boost::mpl::m_item<Key, T, Base>&, boost::mpl::m_item<Key, T, Base>::order*)’ declares a non-template function [-Wnon-template-friend]
     BOOST_MPL_AUX_MAP_OVERLOAD( aux::type_wrapper<item>, ITEM_BY_ORDER, m_item, order* );
                                                                                          ^
boost/mpl/map/aux_/item.hpp:56:85: warning: friend declaration ‘char (& boost::mpl::operator||(const boost::mpl::m_item<Key, T, Base>&, boost::mpl::aux::type_wrapper<T>*))[boost::mpl::m_item<Key, T, Base>::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<Key>* );
                                                                                     ^
boost/mpl/map/aux_/item.hpp:71:121: warning: friend declaration ‘boost::mpl::aux::type_wrapper<mpl_::void_> boost::mpl::operator/(const boost::mpl::m_mask<Key, Base>&, boost::mpl::aux::type_wrapper<T>*)’ declares a non-template function [-Wnon-template-friend]
     BOOST_MPL_AUX_MAP_OVERLOAD( aux::type_wrapper<void_>, VALUE_BY_KEY, m_mask, aux::type_wrapper<Key>* );
                                                                                                                         ^
boost/mpl/map/aux_/item.hpp:72:94: warning: friend declaration ‘boost::mpl::aux::type_wrapper<mpl_::void_> boost::mpl::operator|(const boost::mpl::m_mask<Key, Base>&, boost::mpl::m_mask<Key, Base>::key_order_*)’ declares a non-template function [-Wnon-template-friend]
     BOOST_MPL_AUX_MAP_OVERLOAD( aux::type_wrapper<void_>, ITEM_BY_ORDER, m_mask, key_order_* );

CUDA 7.5

boost/mpl/map/aux_/item.hpp(54): warning: "boost::mpl::aux::type_wrapper<T> operator/(const boost::mpl::m_item<Key, T, Base> &, boost::mpl::aux::type_wrapper<Key> *)" declares a non-template function -- add <> to refer to a template instance

boost/mpl/map/aux_/item.hpp(55): warning: "boost::mpl::aux::type_wrapper<boost::mpl::pair<Key, T>> operator|(const boost::mpl::m_item<Key, T, Base> &, boost::mpl::next<Base::order>::type *)" declares a non-template function -- add <> to refer to a template instance

boost/mpl/map/aux_/item.hpp(56): warning: "char (&operator||(const boost::mpl::m_item<Key, T, Base> &, boost::mpl::aux::type_wrapper<Key> *))[boost::mpl::next<Base::order>::type::value]" declares a non-template function -- add <> to refer to a template instance

boost/mpl/map/aux_/item.hpp(71): warning: "boost::mpl::aux::type_wrapper<mpl_::void_> operator/(const boost::mpl::m_mask<Key, Base> &, boost::mpl::aux::type_wrapper<Key> *)" declares a non-template function -- add <> to refer to a template instance

boost/mpl/map/aux_/item.hpp(72): warning: "boost::mpl::aux::type_wrapper<mpl_::void_> operator|(const boost::mpl::m_mask<Key, Base> &, boost::mpl::x_order_impl<Base, Key>::type *)" declares a non-template function -- add <> to refer to a template instance

boost/mpl/map/aux_/item.hpp:54:109: warning: friend declaration ‘boost::mpl::aux::type_wrapper<Key> boost::mpl::operator/(const boost::mpl::m_item<Key, T, Base>&, boost::mpl::aux::type_wrapper<T>*)’ declares a non-template function [-Wnon-template-friend]
     BOOST_MPL_AUX_MAP_OVERLOAD( aux::type_wrapper<T>, VALUE_BY_KEY, m_item, aux::type_wrapper<Key>* );
                                                                                                             ^
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 <> after the function name here) 
boost/mpl/map/aux_/item.hpp:55:90: warning: friend declaration ‘boost::mpl::aux::type_wrapper<boost::mpl::pair<T1, T2> > boost::mpl::operator|(const boost::mpl::m_item<Key, T, Base>&, boost::mpl::m_item<Key, T, Base>::order*)’ declares a non-template function [-Wnon-template-friend]
     BOOST_MPL_AUX_MAP_OVERLOAD( aux::type_wrapper<item>, ITEM_BY_ORDER, m_item, order* );
                                                                                          ^
boost/mpl/map/aux_/item.hpp:56:85: warning: friend declaration ‘char (& boost::mpl::operator||(const boost::mpl::m_item<Key, T, Base>&, boost::mpl::aux::type_wrapper<T>*))[boost::mpl::m_item<Key, T, Base>::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<Key>* );
                                                                                     ^
boost/mpl/map/aux_/item.hpp:71:121: warning: friend declaration ‘boost::mpl::aux::type_wrapper<mpl_::void_> boost::mpl::operator/(const boost::mpl::m_mask<Key, Base>&, boost::mpl::aux::type_wrapper<T>*)’ declares a non-template function [-Wnon-template-friend]
     BOOST_MPL_AUX_MAP_OVERLOAD( aux::type_wrapper<void_>, VALUE_BY_KEY, m_mask, aux::type_wrapper<Key>* );
                                                                                                                         ^
boost/mpl/map/aux_/item.hpp:72:94: warning: friend declaration ‘boost::mpl::aux::type_wrapper<mpl_::void_> boost::mpl::operator|(const boost::mpl::m_mask<Key, Base>&, boost::mpl::m_mask<Key, Base>::key_order_*)’ declares a non-template function [-Wnon-template-friend]
     BOOST_MPL_AUX_MAP_OVERLOAD( aux::type_wrapper<void_>, ITEM_BY_ORDER, m_mask, key_order_* );

Change History (3)

comment:1 by k.ljunngkvist@…, 7 years ago

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.

comment:2 by Alexander Korsunsky <a.korsunsky@…>, 5 years ago

This is still a problem with NVCC from CUDA 9.0 and with Boost 1.65.1.

Sadly, even adding -Xcompiler -Wno-non-template-friend to the nvcc command line does not help

comment:3 by emmanuel.delor@…, 5 years ago

I have the same issue. The severity may be more than cosmetic, getting thousands of warnings is bad.

Note: See TracTickets for help on using tickets.