This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/67550] Initialization of local struct array with elements of global array yields zeros instead of initializer values
- From: "trippels at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 11 Sep 2015 15:28:31 +0000
- Subject: [Bug c++/67550] Initialization of local struct array with elements of global array yields zeros instead of initializer values
- Auto-submitted: auto-generated
- References: <bug-67550-4 at http dot gcc dot gnu dot org/bugzilla/>
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();
}