I am trying to understand the C++(GCC compiler) expectation of return
statement in a non-void
function.
For example, running this piece of code is working fine:
int foo()
{
throw "blah";
}
While, on the other hand, if we try to use/call some function to complete the throw
, it is facing the well known error/warning of:
no return statement in function returning non-void
for example:
void throw_blah()
{
throw "blah";
}
int foo()
{
throw_blah();
}
I am pretty curious about this as this is directly related to one of my other issue, where just like here, throw
is working fine but using macro
for throw
is facing the same error.