#include <iostream>
#include <string>
using namespace std;
string
crash()
{
}
int
noCrash()
{
}
int
main()
{
crash(); // crashes
// noCrash(); // doesn't crash
return 0;
}
The function crash(), crashes with Mingw g++ 4.6.2 and the function noCrash() executes with no issues. Why does the function returning string crash without a return statement?
Both are undefined behaviors, even
noCrashcan crash.