[Boost-bugs] [Boost C++ Libraries] #7990: Copy constructor for transform_width has an initialization order reversal

Subject: [Boost-bugs] [Boost C++ Libraries] #7990: Copy constructor for transform_width has an initialization order reversal
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-02-06 13:40:06


#7990: Copy constructor for transform_width has an initialization order reversal
----------------------------------------------------+-----------------------
 Reporter: Shane Turner <shane.turner@…> | Owner: jeffrey.hellrung
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: iterator
  Version: Boost 1.53.0 | Severity: Problem
 Keywords: |
----------------------------------------------------+-----------------------
 When compiling against Boost 1.53.0, GCC 4.4.3 and GCC 4.6.3 report an
 error regarding the order of initialization in the copy constructor:

 {{{
 /home/shane.turner/Workbench/boost-
 test/include/3rdParty/boost/archive/iterators/transform_width.hpp: In copy
 constructor ‘boost::archive::iterators::transform_width<Base, BitsOut,
 BitsIn, CharType>::transform_width(const
 boost::archive::iterators::transform_width<B
 ase, BitsOut, BitsIn, CharType>&) [with Base =
 boost::archive::iterators::binary_from_base64<const char*, char>, int
 BitsOut = 8, int BitsIn = 6, CharType = unsigned char]’:
 /home/shane.turner/Workbench/boost-test/include/npString/Base64.hh:42:
 instantiated from here
 /home/shane.turner/Workbench/boost-
 test/include/3rdParty/boost/archive/iterators/transform_width.hpp:104:
 error:
 â€˜boost::archive::iterators::transform_width<boost::archive::iterators::binary_from_base64<const
 char*, char>, 8, 6, unsigned char>::m_remaining_bits’ wil
 l be initialized after
 /home/shane.turner/Workbench/boost-
 test/include/3rdParty/boost/archive/iterators/transform_width.hpp:101:
 error: ‘char
 boost::archive::iterators::transform_width<boost::archive::iterators::binary_from_base64<const
 char*, char>, 8, 6, unsigned char>::m_buffer_in’
 /home/shane.turner/Workbench/boost-
 test/include/3rdParty/boost/archive/iterators/transform_width.hpp:119:
 error: when initialized here
 /home/shane.turner/Workbench/boost-
 test/include/3rdParty/boost/archive/iterators/transform_width.hpp: In copy
 constructor ‘boost::archive::iterators::transform_width<Base, BitsOut,
 BitsIn, CharType>::transform_width(const
 boost::archive::iterators::transform_width<Base, BitsOut, BitsIn,
 CharType>&) [with Base = const char*, int BitsOut = 6, int BitsIn = 8,
 CharType = unsigned char]’:
 /home/shane.turner/Workbench/boost-
 test/include/3rdParty/boost/archive/iterators/base64_from_binary.hpp:103:
 instantiated from ‘boost::archive::iterators::base64_from_binary<Base,
 CharType>::base64_from_binary(const
 boost::archive::iterators::base64_from_binary<Base, CharType>&) [with Base
 = boost::archive::iterators::transform_width<const char*, 6, 8, unsigned
 char>, CharType = unsigned char]’
 /home/shane.turner/Workbench/boost-test/include/npString/Base64.hh:20:
 instantiated from here
 /home/shane.turner/Workbench/boost-
 test/include/3rdParty/boost/archive/iterators/transform_width.hpp:104:
 error: ‘boost::archive::iterators::transform_width<const char*, 6, 8,
 unsigned char>::m_remaining_bits’ will be initialized after
 /home/shane.turner/Workbench/boost-
 test/include/3rdParty/boost/archive/iterators/transform_width.hpp:101:
 error: ‘char boost::archive::iterators::transform_width<const char*, 6,
 8, unsigned char>::m_buffer_in’
 /home/shane.turner/Workbench/boost-
 test/include/3rdParty/boost/archive/iterators/transform_width.hpp:119:
 error: when initialized here
 }}}

 The fix is a simple swap of two lines in the copy constructor.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7990>
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:11 UTC