This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/54046] [4.6/4.7/4.8 Regression] wrong control reaches end of non-void function for switch case with throw and default


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54046

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-23 16:04:14 UTC ---
Author: jakub
Date: Fri Nov 23 16:04:03 2012
New Revision: 193762

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193762
Log:
    PR c++/54046
    * Makefile.in (gimple-low.o): Depend on langhooks.h.
    * gimple-low.c: Include langhooks.c.
    (block_may_fallthru): Handle TARGET_EXPR and ERROR_MARK,
    by default call lang_hooks.block_may_fallthru.
    * langhooks.h (struct lang_hooks): Add block_may_fallthru
    langhook.
    * langhooks-def.h (LANG_HOOKS_BLOCK_MAY_FALLTHRU): Define.
    (LANG_HOOKS_INITIALIZER): Use it.

    * cp-objcp-common.h (LANG_HOOKS_BLOCK_MAY_FALLTHRU): Redefine.
    * cp-objcp-common.c (cxx_block_may_fallthru): New function.
    * cp-tree.h (cxx_block_may_fallthru): New prototype.

    * g++.dg/warn/Wreturn-type-8.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/warn/Wreturn-type-8.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/Makefile.in
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-objcp-common.c
    trunk/gcc/cp/cp-objcp-common.h
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/gimple-low.c
    trunk/gcc/langhooks-def.h
    trunk/gcc/langhooks.h
    trunk/gcc/testsuite/ChangeLog


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]