http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50268
Bug #: 50268 Summary: [C++0x] bitset doesn't sanitize input Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: marc.gli...@normalesup.org #include <bitset> #include <iostream> int main(){ std::bitset<1> b(3); std::cout << b.count() << std::endl; } Prints 1 with -std=c++98 and 2 with -std=c++0x. (I noticed it while wondering why _M_are_all_aux uses popcount, which isn't optimal)