http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57704
Bug ID: 57704 Summary: std::char_traits<char>::lt is not standards-compliant Product: gcc Version: 4.7.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: tudorb at fb dot com Created attachment 30356 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30356&action=edit simple example to illustrate the bug The C++11 standard says in 21.2.3.1 (struct char_traits<char>): "The two-argument members eq and lt shall be defined identically to the built-in operators == and < for type unsigned char." However, this is not the case if char is signed (tested using gcc 4.1.2, 4.6.2, and 4.7.1 on x86_64, but the trunk version of char_traits.h is the same); char_traits<char>::lt compares the two values as char, not as unsigned char. The attached program should print 1 twice when this bug is fixed.