This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/19199] [3.3/3.4/4.0/4.1 Regression] Wrong warning about returning a reference to a temporary


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]