[Bug c++/80272] New: g++ runs out of memory and crashes
bkropki at yahoo dot co.uk
gcc-bugzilla@gcc.gnu.org
Fri Mar 31 16:19:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80272
Bug ID: 80272
Summary: g++ runs out of memory and crashes
Product: gcc
Version: 4.9.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: bkropki at yahoo dot co.uk
Target Milestone: ---
Created attachment 41096
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41096&action=edit
C++ code which crashes g++
g++ runs out of memory and crashes, when the following simple code is compiled
#include <array>
const int ARR_SIZE = 0x10000; // 64 K
struct A {
char whatever;
A() { whatever = 0; }; // removing constructor removes the problem
};
class B {
std::array<std::array<A, 8>, ARR_SIZE> values;
public:
B();
};
B::B() : values{} // removing explicit initialisation of values (i.e.
removing ": values{}") removes the problem
{}
int main() { return 0; }
More information about the Gcc-bugs
mailing list