From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3861 invoked by alias); 4 Apr 2005 13:41:43 -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 3754 invoked by alias); 4 Apr 2005 13:41:33 -0000 Date: Mon, 04 Apr 2005 13:41:00 -0000 Message-ID: <20050404134133.3753.qmail@sourceware.org> From: "joseph at codesourcery dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20041230105911.19199.lars@trolltech.com> References: <20041230105911.19199.lars@trolltech.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/19199] [3.3/3.4/4.0/4.1 Regression] Wrong warning about returning a reference to a temporary X-Bugzilla-Reason: CC X-SW-Source: 2005-04/txt/msg00297.txt.bz2 List-Id: ------- Additional Comments From joseph at codesourcery dot com 2005-04-04 13:41 ------- Subject: Re: [Committed] PR c++/19199: Preserve COND_EXPR lvalueness in fold On Mon, 4 Apr 2005, Alexandre Oliva wrote: > Err... Why did you choose to drop the portion of the patch below, > that would have avoided the ugliness of comparing langhooks.name, but > still retained it in the ChangeLog entry? pedantic_lvalues means "this is C, until I manage to disentangle enough C/C++/ObjC interactions to keep lvalueness internal to the C front end so pedantic_lvalues can go away". Checking langhooks.name tests for C++, i.e. they differ in their effects for all languages other than C/ObjC/C++: only C/ObjC require that conditional expressions not be turned into lvalues if they weren't such to start with, while only C++ requires that conditional expressions which were lvalues be preserved in their original form. The proper hook to check is one meaning "this is C++" rather than "this is not C", though perhaps adding a new hook "fold_preserve_cond_expr_p" would be cleaner than checking langhooks.name. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19199