From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30919 invoked by alias); 4 May 2015 14:13:33 -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 30883 invoked by uid 48); 4 May 2015 14:13:28 -0000 From: "evangelos at foutrelis dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/66007] New: [5 Regression] Narrowing conversion inside { } results in all zero elements in C++11 mode Date: Mon, 04 May 2015 14:13:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 5.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: evangelos at foutrelis dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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 target_milestone 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: 2015-05/txt/msg00238.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66007 Bug ID: 66007 Summary: [5 Regression] Narrowing conversion inside { } results in all zero elements in C++11 mode Product: gcc Version: 5.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: evangelos at foutrelis dot com Target Milestone: --- Created attachment 35453 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35453&action=edit Different narrowing behavior between GCC 4.9 and GCC 5 This is related to PR c++/65801 which allowed -Wno-narrowing to be used to silence narrowing errors in C++11 mode. Compiling something like "int foo[] = { 1, 0xFFFFFFFF, 3 };" with "-std=c++11 -Wno-error=narrowing" will initialize foo to {0, 0, 0}, whereas GCC 4.9 would initialize it to {1, -1, 3}. (Attached is the assembler code generated by both GCC versions.) (This change in behavior causes at least one crash in Chromium; when using the search box on the settings page, the tab will crash.)