From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9223 invoked by alias); 24 Jun 2013 22:20:30 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 9196 invoked by uid 48); 24 Jun 2013 22:20:27 -0000 From: "tudorb at fb dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/57704] New: std::char_traits::lt is not standards-compliant Date: Mon, 24 Jun 2013 22:20:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.7.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tudorb at fb dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-06/txt/msg01415.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57704 Bug ID: 57704 Summary: std::char_traits::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): "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::lt compares the two values as char, not as unsigned char. The attached program should print 1 twice when this bug is fixed.