Strictly, undefined behavior not a compiler error. https://stackoverflow.com/questions/9936011/if-a-function-returns-no-value-with-a-valid-return-type-is-it-okay-to-for-the explains the rationale.
However, in practice,
- For an int function the compiler could return any int value.
- For functions returning type AA, I don’t know what is returned. Could it be a default-constructed instance of AA?
- My specific case — I modified a well-behaving function to introduce an exception. I then added a catch-all block without a return value. Actually worked fine. So some instance of AA is actually returned!