This revision was automatically updated to reflect the committed changes.
Closed by commit rL280543: Avoid narrowing warnings in __bitset constructor
(authored by dim).
Changed prior to commit:
https://reviews.llvm.org/D23960?vs=69489&id=70231#toc
Repository:
rL LLVM
https://reviews.llvm.or
dim added a comment.
@mclow.lists, I tested code generation (on i386-freebsd) with this small sample
program:
#include
void f(const std::bitset<53>&);
void g(void)
{
std::bitset<53> bs(0x1234567890abcdef);
f(bs);
}
The assembly doesn't change at all after this fix:
g
EricWF accepted this revision.
EricWF added a comment.
This revision is now accepted and ready to land.
LGTM. Sorry this took so long. I was confused about the narrowing rules.
https://reviews.llvm.org/D23960
___
cfe-commits mailing list
cfe-commits
dim added inline comments.
Comment at: include/bitset:262
@@ -261,3 +261,3 @@
#elif __SIZEOF_SIZE_T__ == 4
-: __first_{__v, __v >> __bits_per_word}
+: __first_{static_cast<__storage_type>(__v),
static_cast<__storage_type>(__v >> __bits_per_word)}
#else
EricWF added inline comments.
Comment at: include/bitset:262
@@ -261,3 +261,3 @@
#elif __SIZEOF_SIZE_T__ == 4
-: __first_{__v, __v >> __bits_per_word}
+: __first_{static_cast<__storage_type>(__v),
static_cast<__storage_type>(__v >> __bits_per_word)}
#else
--
dim added a comment.
Ping...
https://reviews.llvm.org/D23960
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
dim created this revision.
dim added reviewers: mclow.lists, EricWF.
dim added subscribers: emaste, cfe-commits.
When I compile is compiled with warnings enabled, I get the
following error (which is interesting in itself, it should only be a
warning):
/usr/include/c++/v1/bitset:265:16: error