struct x struct z<x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(y,x(y><y*,x(y*w>v<y*,w,x{}
A tiny 79 bytes that explodes into a huge stacktrace that takes an inordinate amount of time to finish processing.Also see https://codegolf.stackexchange.com/questions/1956/generate-t...
$ g++ test.cpp 2>&1 > /dev/null | wc -l
10223622
Ten million lines.The template expansion machinery is pretty much a purely functional language and the compiler is the interpreter. The stacktrace in this case is not of the interpreter itself but of the program being executed.
In fact understanding that template error messages are none other than execution stack traces is key to making sense them.
Initialize at least one member so that it gets placed in data section instead of bss resulting in binary size more or less the same as array. Although at least on my system various parts of toolchain start to break down once you reach 2GB limit.
const main[255<<21]={195};
You can also get around the 2Gb limit by using the -mcmodel flag, such as 'gcc -mcmodel=medium FILE'. But then actually compiling the thing takes a long time and a heck of a lot of memory: const main[-1u]={195};The C++ template answers are particularly scary...
At some point (to lazy to look up the flag) gcc added a template recursion parameter that stops trying to unroll everything at some sane depth. Now the code compiles quickly the .exes are reasonably sized/etc.