https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103153
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Xinmeng Xia from comment #0) > The following code can be well compiled, however when execute it, GCC > crashes with segmentation fault. No, your program crashes, GCC doesn't. Any use of main is undefined in C++, especially calling it. This program is just broken and of course it crashes.