Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#7990 closed Bugs (fixed)

Copy constructor for transform_width has an initialization order reversal

Reported by: Shane Turner <shane.turner@…> Owned by: Robert Ramey
Milestone: Boost 1.54.0 Component: serialization
Version: Boost Development Trunk Severity: Problem
Keywords: Cc: shane.turner@…

Description

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.

Attachments (1)

transform_width.hpp.diff (542 bytes ) - added by Shane Turner <shane.turner@…> 10 years ago.
Patch to fix copy constructor

Download all attachments as: .zip

Change History (8)

by Shane Turner <shane.turner@…>, 10 years ago

Attachment: transform_width.hpp.diff added

Patch to fix copy constructor

comment:1 by Shane Turner <shane.turner@…>, 10 years ago

Cc: shane.turner@… added

According to the svn logs, ramey was the last person to change transform_width.hpp, so it's possible, based on other bugs assigned to him, that the correct component is serialization.

comment:2 by Michel Morin, 10 years ago

Component: iteratorserialization
Owner: changed from jeffrey.hellrung to Robert Ramey

comment:3 by Robert Ramey, 10 years ago

Resolution: fixed
Status: newclosed

comment:4 by anonymous, 9 years ago

Milestone: To Be DeterminedBoost 1.54.0
Resolution: fixed
Status: closedreopened
Version: Boost 1.53.0Boost Development Trunk

It appears this patch hasn't been applied to the trunk?

comment:5 by reed@…, 9 years ago

Please provide the commit revision number for the fix in 1.54.0. Thanks

comment:6 by Robert Ramey, 9 years ago

Resolution: fixed
Status: reopenedclosed

ok patched - subject to test

comment:7 by Chris Stylianou <chris5287@…>, 9 years ago

Will this be merged into release for 1.55?

Note: See TracTickets for help on using tickets.