[PATCH] D23960: Avoid narrowing warnings in __bitset constructor

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 1 11:00:17 PDT 2016


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
----------------
Only the first one actually requires a cast, correct? The second should never be a potentially narrowing conversion.


https://reviews.llvm.org/D23960





More information about the cfe-commits mailing list