This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/68949] [5/6 Regression] Implicit initialization of array member silently miscompiling.


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68949

--- Comment #4 from Wouter van Kesteren <woutershep at gmail dot com> ---
I realise that maybe in my effort to make a tiny testcase without headers so
that the .ii wasnt hundreds of lines the testcase might have become a bit hard
to grasp. I'll attach a second cc with a iostream include and a cout to
hopefully clarify things up a bit:

% x86_64-pc-linux-gnu-g++-5.3 -std=c++11 -Wall -Wextra -o zero-cout
zero-cout.cc && ./zero-cout
Expected c.s[0].i to be '-1', got '0'

% x86_64-pc-linux-gnu-g++-4.9 -std=c++11 -Wall -Wextra -o zero-cout
zero-cout.cc && ./zero-cout
Expected c.s[0].i to be '-1', got '-1'

% clang++ -std=c++11 -Wall -Wextra -o zero-cout zero-cout.cc && ./zero-cout
Expected c.s[0].i to be '-1', got '-1'

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]