From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1950 invoked by alias); 9 Sep 2005 15:41:50 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 1926 invoked by alias); 9 Sep 2005 15:41:46 -0000 Date: Fri, 09 Sep 2005 15:41:00 -0000 Message-ID: <20050909154146.1923.qmail@sourceware.org> From: "joseph at codesourcery dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20001111043600.772.jsm28@gcc.gnu.org> References: <20001111043600.772.jsm28@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/772] Statement expressions issues X-Bugzilla-Reason: CC X-SW-Source: 2005-09/txt/msg01140.txt.bz2 List-Id: ------- Additional Comments From joseph at codesourcery dot com 2005-09-09 15:41 ------- Subject: Re: Statement expressions issues On Fri, 9 Sep 2005, rguenth at gcc dot gnu dot org wrote: > No testcase? But I think this is fixed on the mainline and only pending on 4.0. > See PR17913. The test is gcc.dg/stmt-expr-label-*.c (modulo the exact diagnostic text) and I don't think this is fixed for C++ on mainline. This is separate from bug 17913 where there is a case which is valid at compile time and invalid at runtime, involving computed gotos: gcc.c-torture/compile/pr17913.c, which formerly ICEd with optimization but was fixed not to do so (at least for C; appears fixed for C++ as well with the mainline/4.0 compilers I have to hand to test but they are rather old). It just happens that almost all cases of bug 17913 were addressed for C by fixing bug 772 for C, leaving only the case of computed gotos to be fixed separately in 17913 (for C). The rules for invalidity for jumps into statement expressions are much the same as those in C++ for jumps bypassing initializations (imagining that each statement expression starts with such an initialization); it might be possible to reuse that code to fix this bug for C++. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=772