[Bug c++/67550] Initialization of local struct array with elements of global array yields zeros instead of initializer values
trippels at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Sep 11 15:28:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67550
Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-09-11
CC| |trippels at gcc dot gnu.org
Known to work| |4.9.3
Ever confirmed|0 |1
Known to fail| |5.2.1, 6.0
--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Also happens with a local array:
struct S {
int x;
int y;
};
int foo() { return 1; }
int main() {
S const data[] = {{0, foo()}};
S data2[] = {data[0]};
if (!data2[0].y)
__builtin_abort();
}
More information about the Gcc-bugs
mailing list