Aside from the fact (as has already been pointed out in previous posts) that your reference to convertToYen in main is a function declaration, the code should not compile with no value being returned from convertToYen as long as it has a return type of double.
Sad, that is. Apparently all the standard has to say about it is:
6.6.3.2
Flowing off the end of a function is equivalent to a return with no value; this results in undefined
behavior in a value-returning function.
And the standard doesn't require a diagnostic for undefined behavior, although, since it is trivially detectable in cases where there are no return statements in the function body, one would expect a warning as a QOI issue.
MSVC++ generates an error by default for functions that can be proved don't return values and a warning for cases where it just may be the case. (That behavior can, of course, be adjusted.)
> MSVC++ generates an error by default for functions that can be proved don't return values
> and a warning for cases where it just may be the case.
Kudos to MSVC for that; IMHO the MSVC default behaviour should be the default in every compiler.
If it can be detected by static flow analysis that that the code is patently incorrect, issue an error diagnostic; and if it may be incorrect, issue a warning diagnostic.