Opened 7 years ago

Closed 5 years ago

#12140 closed Patches (fixed)

Warning about useless "explicit" in base_from_member.hpp

Reported by: Thimo Neubauer <thimo.neubauer@…> Owned by: Marshall Clow
Milestone: To Be Determined Component: utility
Version: Boost 1.61.0 Severity: Problem
Keywords: Cc:

Description

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

Attachments (1)

base_from_member.diff (1.0 KB ) - added by Thimo Neubauer <thimo.neubauer@…> 7 years ago.
Fix for Boost 1.60

Download all attachments as: .zip

Change History (3)

by Thimo Neubauer <thimo.neubauer@…>, 7 years ago

Attachment: base_from_member.diff added

Fix for Boost 1.60

comment:1 by Marshall Clow, 6 years ago

Owner: changed from No-Maintainer to Marshall Clow
Status: newassigned

Committed 34e05cb to fix this; will merge to release after the tests cycle.

comment:2 by Marshall Clow, 5 years ago

Resolution: fixed
Status: assignedclosed

This was shipped as part of 1.64.0

Note: See TracTickets for help on using tickets.