From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19587 invoked by alias); 1 Feb 2013 14:03:19 -0000 Received: (qmail 19102 invoked by uid 55); 1 Feb 2013 14:02:43 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/54046] [4.6/4.7 Regression] wrong control reaches end of non-void function for switch case with throw and default Date: Fri, 01 Feb 2013 14:03:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.4 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-02/txt/msg00039.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54046 --- Comment #8 from Jakub Jelinek 2013-02-01 14:02:41 UTC --- Author: jakub Date: Fri Feb 1 14:02:33 2013 New Revision: 195651 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195651 Log: Backported from mainline 2012-11-23 Jakub Jelinek 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: branches/gcc-4_7-branch/gcc/testsuite/g++.dg/warn/Wreturn-type-8.C Modified: branches/gcc-4_7-branch/gcc/ChangeLog branches/gcc-4_7-branch/gcc/Makefile.in branches/gcc-4_7-branch/gcc/cp/ChangeLog branches/gcc-4_7-branch/gcc/cp/cp-objcp-common.c branches/gcc-4_7-branch/gcc/cp/cp-objcp-common.h branches/gcc-4_7-branch/gcc/cp/cp-tree.h branches/gcc-4_7-branch/gcc/gimple-low.c branches/gcc-4_7-branch/gcc/langhooks-def.h branches/gcc-4_7-branch/gcc/langhooks.h branches/gcc-4_7-branch/gcc/testsuite/ChangeLog