[RFA] DR 1325 vs cons/2.cc

Paolo Carlini paolo.carlini@oracle.com
Mon Oct 11 18:13:00 GMT 2010


Hi all, hi Jon,

today I decided to implement the simple resolution of DR 1325, now
Tentatively Ready, just to be sure we are not doing anything wrong.
Indeed, everything seems ok a far as our implementation is concerned,
besides the existing testcase cons/2.cc, devised by Jon to test that the
old constructor taking a const char* was actually used when appropriate
and preferred to the one taking a basic_string via a conversion. Now it
doesn't pass anymore: the constructor taking an unsigned long long gets
in the way, we get:

2.cc:36:23: error: invalid conversion from ‘const char*’ to ‘long long
unsigned intÂ’ [-fpermissive]
.../include/c++/4.6.0/bitset:807:7: error: initializing argument 1 of
‘std::bitset<_Nb>::bitset(long long unsigned int) [with long unsigned
int _Nb = 32ul]Â’ [-fpermissive]

For your convenience I'm attaching 2.cc here together with my draft patch.

Are we Ok with the behavior of the new set of constructors? Can we
safely remove 2.cc or replace it by a slightly different one? Note, the
constructor taking an unsigned long long would be actually constexpr,
but I don't *think* that would change anything...

Thanks,
Paolo.

////////////////////
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2.cc
Type: text/x-c++src
Size: 1124 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20101011/9888cd1e/attachment.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_dr1325
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20101011/9888cd1e/attachment.ksh>


More information about the Libstdc++ mailing list