public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/66007] New: [5 Regression] Narrowing conversion inside { } results in all zero elements in C++11 mode
@ 2015-05-04 14:13 evangelos at foutrelis dot com
  2015-05-04 14:34 ` [Bug c++/66007] " trippels at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: evangelos at foutrelis dot com @ 2015-05-04 14:13 UTC (permalink / raw)
  To: gcc-bugs

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.)


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-05-04 21:23 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-04 14:13 [Bug c++/66007] New: [5 Regression] Narrowing conversion inside { } results in all zero elements in C++11 mode evangelos at foutrelis dot com
2015-05-04 14:34 ` [Bug c++/66007] " trippels at gcc dot gnu.org
2015-05-04 14:50 ` trippels at gcc dot gnu.org
2015-05-04 16:10 ` jakub at gcc dot gnu.org
2015-05-04 16:22 ` evangelos at foutrelis dot com
2015-05-04 16:31 ` [Bug c++/66007] [5/6 Regression] Narrowing conversion inside { } results in all zero elements in C++11 mode with -Wno-error=narrowing trippels at gcc dot gnu.org
2015-05-04 16:33 ` paolo.carlini at oracle dot com
2015-05-04 16:34 ` paolo.carlini at oracle dot com
2015-05-04 16:40 ` jakub at gcc dot gnu.org
2015-05-04 17:46 ` paolo.carlini at oracle dot com
2015-05-04 20:59 ` paolo at gcc dot gnu.org
2015-05-04 20:59 ` paolo at gcc dot gnu.org
2015-05-04 21:23 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).