In this example will be called deconstructor of nonexisting object. G++ version 5.3, compiling with -Werror .
vector<vector<float>> segfault()
{
}
int main()
{
segfault();
return 0;
}
In this example will be called deconstructor of nonexisting object. G++ version 5.3, compiling with -Werror .
vector<vector<float>> segfault()
{
}
int main()
{
segfault();
return 0;
}
Both gcc and clang have the option -Wreturn-type.
It is turned on implicitly when using -Wall.
To make it is a compiler error, use -Werror=return-type.