https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97677
Bug ID: 97677 Summary: std::array and std::initializer_list gives wrong results Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: peter_foelsche at mentor dot com Target Milestone: --- Created attachment 49487 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49487&action=edit ConsoleApplication2.cpp g++ 5.3.0 gives wrong results: orw-ams-ms7 /scratch/pfoelsch : g++ ConsoleApplication2.cpp -std=c++11 orw-ams-ms7 /scratch/pfoelsch : g++ --version g++ (GCC) 5.3.0 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. orw-ams-ms7 /scratch/pfoelsch : ./a.out t2[0]=0.761594 t2[1]=4.19974 t3[0]=-0.661594 t3[1]=-4.19974 t3[2]=1 t4[0]=0 t4[1]=0 t4[2]=1 orw-ams-ms7 /scratch/pfoelsch : g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 gives correct results: pfoelsch@txa-pfoelsch-lt:/mnt/c/MGC_NOSCAN/ConsoleApplication2$ g++ ConsoleApplication2.cpp -std=c++11 pfoelsch@txa-pfoelsch-lt:/mnt/c/MGC_NOSCAN/ConsoleApplication2$ g++ --version g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. pfoelsch@txa-pfoelsch-lt:/mnt/c/MGC_NOSCAN/ConsoleApplication2$ ./a.out t2[0]=0.761594 t2[1]=4.19974 t3[0]=-0.661594 t3[1]=-4.19974 t3[2]=1 t4[0]=-0.661594 t4[1]=-4.19974 t4[2]=1