http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47749
--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-09-28 15:35:22 UTC --- First blush, I would say this is malformed code, even if we produce "only" a warning with -Wreturn-type. And after all we produce only a warning also for false substituted to flag in the conditional or if we remove the conditional altogether: why nobody is complaining that we don't just reject: bool fn_bad(bool flag) { } ? If we check the standard carefully (we/I should), I bet it says that here we have undefined behavior (with all its implications) irrespective of the actual flow at run-time, even if diagnostics is not required.