Example:
int foo() { throw 0; }
int bar() { foo(); }
foo here doesn't get a warning, while bar gets the error "must return a value". More typically, bar would have some return statements and get the warning "not all control paths return a value".
Why isn't an indirect throw recognized as a proper way to exit the function? How can I work around it, ideally by modifying foo and not bar?
The actual example I have in mind is that I have a ThreadSafeExit function which calls the test platform's Exit function, and I hoped that adding throw 0 at the end would get rid of warnings.
noreturnattribute for such purposes.