https://bugs.llvm.org/show_bug.cgi?id=35438
Bug ID: 35438
Summary: std::bitset::bitset(unsigned long long) does not zero
unused bits
Product: libc++
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: te...@chromium.org
CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com
As per the standard, the std::bitset<n>::bitset(unsigned long long x)
constructor should only take the lowest n bits from the argument, however, the
libc++ implementation stores the argument unchanged in its backing store, which
can be observed by the to_ulong() member function.
Example:
std::bitset<8> x(10000000);
printf("%zu\n", x.to_ulong());
This should output 255, but it outputs 10000000.
Also, this behavior is different from libstdc++, which is standard compliant in
this case.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs