int f(int n)
{
if (n > 0) return 1;
}
int main()
{
f(0); // Does the C++ standard see this as an error?
}
Another example:
int f()
{
try
{
return mayThrow();
}
catch(...)
{
throw; // rethrow and no return. Is this conforming to the C++ standard?
}
}
int main()
{
f();
}
Third example:
int f()
{
try
{
throw 0;
}
catch(...)
{
throw; // rethrow and no return. Is this conforming to the C++ standard?
}
}
int main()
{
f();
}