[Boost-bugs] [Boost C++ Libraries] #12140: Warning about useless "explicit" in base_from_member.hpp

Subject: [Boost-bugs] [Boost C++ Libraries] #12140: Warning about useless "explicit" in base_from_member.hpp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-04-20 11:32:26


#12140: Warning about useless "explicit" in base_from_member.hpp
-----------------------------------------------+---------------------------
 Reporter: Thimo Neubauer <thimo.neubauer@…> | Owner: no-maintainer
     Type: Patches | Status: new
Milestone: To Be Determined | Component: utility
  Version: Boost 1.61.0 | Severity: Problem
 Keywords: |
-----------------------------------------------+---------------------------
 In our build with Intel Compiler XE 2016 we have the additional warning
 option {{{-Wnon-virtual-dtor}}} enabled. With it we get the following
 massive warning:

 {{{
 In file included from
 ../../../Third_Party_Libraries/Boost/include/boost/utility.hpp(13),
                  from
 ../../../Third_Party_Libraries/Boost/include/boost/iterator/reverse_iterator.hpp(10),
                  from
 ../../../Third_Party_Libraries/Boost/include/boost/range/reverse_iterator.hpp(18),
                  from
 ../../../Third_Party_Libraries/Boost/include/boost/range/rbegin.hpp(18),
                  from
 ../../../Third_Party_Libraries/Boost/include/boost/range/functions.hpp(23),
                  from
 ../../../Third_Party_Libraries/Boost/include/boost/range/iterator_range_core.hpp(24),
                  from
 ../../../Third_Party_Libraries/Boost/include/boost/range/iterator_range.hpp(13),
                  from
 ../../../Third_Party_Libraries/Boost/include/boost/assign/list_of.hpp(20),
                  from
 ../../../Third_Party_Libraries/Boost/include/boost/assign.hpp(20),
                  from 1DFunction.cpp(3):
 ../../../Third_Party_Libraries/Boost/include/boost/utility/base_from_member.hpp(75):
 warning #2305: declaration of 'explicit' constructor without a single
 argument is redundant
       template < typename T0 > explicit base_from_member( T0 x0 ) :
 member( x0 ) {} template < typename T0 , typename T1 > explicit
 base_from_member( T0 x0 , T1 x1 ) : member( x0 , x1 ) {} template <
 typename T0 , typename T1 , typename T2 > explicit base_from_member( T0
 x0 , T1 x1 , T2 x2 ) : member( x0 , x1 , x2 ) {} template < typename T0
 , typename T1 , typename T2 , typename T3 > explicit base_from_member( T0
 x0 , T1 x1 , T2 x2 , T3 x3 ) : member( x0 , x1 , x2 , x3 ) {} template <
 typename T0 , typename T1 , typename T2 , typename T3 , typename T4 >
 explicit base_from_member( T0 x0 , T1 x1 , T2 x2 , T3 x3 , T4 x4 ) :
 member( x0 , x1 , x2 , x3 , x4 ) {} template < typename T0 , typename T1
 , typename T2 , typename T3 , typename T4 , typename T5 > explicit
 base_from_member( T0 x0 , T1 x1 , T2 x2 , T3 x3 , T4 x4 , T5 x5 ) :
 member( x0 , x1 , x2 , x3 , x4 , x5 ) {} template < typename T0 ,
 typename T1 , typename T2 , typename T3 , typename T4 , typename T5 ,
 typename T6 > explicit base_from_member( T0 x0 , T1 x1 , T2 x2 , T3 x3 ,
 T4 x4 , T5 x5 , T6 x6 ) : member( x0 , x1 , x2 , x3 , x4 , x5 , x6 ) {}
 template < typename T0 , typename T1 , typename T2 , typename T3 ,
 typename T4 , typename T5 , typename T6 , typename T7 > explicit
 base_from_member( T0 x0 , T1 x1 , T2 x2 , T3 x3 , T4 x4 , T5 x5 , T6 x6 ,
 T7 x7 ) : member( x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 ) {} template <
 typename T0 , typename T1 , typename T2 , typename T3 , typename T4 ,
 typename T5 , typename T6 , typename T7 , typename T8 > explicit
 base_from_member( T0 x0 , T1 x1 , T2 x2 , T3 x3 , T4 x4 , T5 x5 , T6 x6 ,
 T7 x7 , T8 x8 ) : member( x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 ) {}
 template < typename T0 , typename T1 , typename T2 , typename T3 ,
 typename T4 , typename T5 , typename T6 , typename T7 , typename T8 ,
 typename T9 > explicit base_from_member( T0 x0 , T1 x1 , T2 x2 , T3 x3 ,
 T4 x4 , T5 x5 , T6 x6 , T7 x7 , T8 x8 , T9 x9 ) : member( x0 , x1 , x2 ,
 x3 , x4 , x5 , x6 , x7 , x8 , x9 ) {}
 ^
 }}}

 The fix isn't too difficult: add the one-argument constructor explicitly
 (and with explicit keyword) and let the preprocessor generate the rest
 without. I've attached the fix for Boost 1.60

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12140>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC