https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66139
--- Comment #10 from Ondřej Majerech <majerech.o at gmail dot com> --- That SO answer appears to be plain out wrong. Running your snippet on GCC 6.3.1 and 8.0.0 20170507, the program calls terminate for me, even with the cout << "Welcome" line included.