This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19199] [3.3/3.4/4.0/4.1 Regression] Wrong warning about returning a reference to a temporary
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Apr 2005 13:41:33 -0000
- Subject: [Bug c++/19199] [3.3/3.4/4.0/4.1 Regression] Wrong warning about returning a reference to a temporary
- References: <20041230105911.19199.lars@trolltech.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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