This is definitely a mistake. I can reproduce this with 5.3 on my system. RAM usage is increasing rapidly, but I closed the program because I do not want my system to crash. On the other hand, if I compile it in Clang 3.8, it compiles almost instantly.
I suggest reporting this to gcc.gnu.org/bugzilla. As indicated here, view error reports 59659, 68203, and 56671. I am sure that they all point to the same problem as GCC's inability to have a large array of non-trivial class type.
source share