http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48087
Paolo Carlini <paolo.carlini at oracle dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2011-10-18 CC| |paolo.carlini at oracle dot | |com Ever Confirmed|0 |1 --- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-10-18 01:18:24 UTC --- Well, this does, it (fixes both) but I don't know if we are aiming for something better, no good including the whole "diagnostic.h"?!? Index: tree-cfg.c =================================================================== --- tree-cfg.c (revision 180119) +++ tree-cfg.c (working copy) @@ -37,7 +37,7 @@ along with GCC; see the file COPYING3. If not see #include "timevar.h" #include "tree-dump.h" #include "tree-pass.h" -#include "diagnostic-core.h" +#include "diagnostic.h" #include "except.h" #include "cfgloop.h" #include "cfglayout.h" @@ -7380,7 +7380,8 @@ execute_warn_function_return (void) else if (warn_return_type && !TREE_NO_WARNING (cfun->decl) && EDGE_COUNT (EXIT_BLOCK_PTR->preds) > 0 - && !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (cfun->decl)))) + && !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (cfun->decl))) + && !errorcount) { FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds) {