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 , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 13 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:3 by , 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:5 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Closed as for description it is already fixed.
(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