Opened 13 years ago

Closed 10 years ago

#3984 closed Bugs (fixed)

utility/swap std_bitset regression failure on msvc-10 (RC)

Reported by: niels_dekker Owned by: niels_dekker
Milestone: Boost 1.43.0 Component: utility
Version: Boost 1.42.0 Severity: Problem
Keywords: Cc:

Description

boost/trunk/libs/utility/swap/test/std_bitset.cpp revision 53141 does:

    typedef std::bitset<8> bitset_type;
    const bitset_type initial_value1 = 1ul;
    const bitset_type initial_value2 = 2ul;

Microsoft Visual C++ 10 RC rejects this piece of code, according to http://www.boost.org/development/tests/trunk/developer/output/RWVC10-boost-bin-v2-libs-utility-swap-test-std_bitset-test-msvc-10-0-debug-threading-multi.html which says:

 Test output: RWVC10 - utility/swap - std_bitset / msvc-10.0
Rev 60096 / Wed, 3 Mar 2010 11:41:12 +0000
Report Time: Wed, 3 Mar 2010 23:58:03 +0000

Compile [2010-03-03 16:35:50 UTC]: fail

    call "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/vcvarsall.bat" x86 >nul
cl /Zm800 -nologo @"C:\run\results\boost\bin.v2\libs\utility\swap\test\std_bitset.test\msvc-10.0\debug\threading-multi\std_bitset.obj.rsp" 

std_bitset.cpp
..\libs\utility\swap\test\std_bitset.cpp(20) : error C2440: 'initializing' : cannot convert from 'unsigned long' to 'std::bitset<_Bits>'
        with
        [
            _Bits=8
        ]
        No constructor could take the source type, or constructor overload resolution was ambiguous
..\libs\utility\swap\test\std_bitset.cpp(21) : error C2440: 'initializing' : cannot convert from 'unsigned long' to 'std::bitset<_Bits>'
        with
        [
            _Bits=8
        ]
        No constructor could take the source type, or constructor overload resolution was ambiguous

This is caused by a bug, reported to Microsoft by Richard Webb: https://connect.microsoft.com/VisualStudio/feedback/details/532897/problems-constructing-a-bitset-from-an-unsigned-long-in-the-vc-rc

Juergen Hunold tested various workarounds at msvc-10.0, msvc-9.0 and gcc-4.4. See also [boost] [utility/swap] MSVC 10 test failure, unsigned long to std::bitset conversion invalid?, http://lists.boost.org/Archives/boost/2010/03/162690.php

Change History (5)

comment:1 by niels_dekker, 13 years ago

Resolution: fixed
Status: newclosed

(In [60331]) Hopefully fixed #3984 (std::bitset constructor issue). Tested by Juergen Hunold on msvc-10.0, msvc-9.0, and gcc-4.4. See thread starting at http://lists.boost.org/Archives/boost/2010/03/162690.php

comment:2 by niels_dekker, 13 years ago

Resolution: fixed
Status: closedreopened

Hmmm, Trac appears to have closed the ticket automagically, because the commit message of [60331] contained the text fixed #3984. That was not intended! Before closing, I would like to see the regression results, and I would like the the release branch to be fixed as well.

comment:3 by niels_dekker, 13 years ago

Related issue of the Standard C++ Library Working Group, submitted by Christopher Jefferson: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3087.html#1325

comment:4 by niels_dekker, 13 years ago

Merged the fix to the release branch: [61077]

comment:5 by viboes, 10 years ago

Resolution: fixed
Status: reopenedclosed

Closed as for description it is already fixed.

Note: See TracTickets for help on using tickets.