This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
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.
--
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
jsm@polyomino.org.uk (personal mail)
joseph@codesourcery.com (CodeSourcery mail)
jsm28@gcc.gnu.org (Bugzilla assignments and CCs)