This is the mail archive of the gcc-patches@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]

Re: C++ PATCH to require real lvalues in expressions


On 9/27/2010 1:23 PM, Jason Merrill wrote:

> The C++ standard has always required a real lvalue for the first operand
> of &, =, += and such, but G++ has allowed class temporaries and, in
> C++0x mode, rvalue references.  This patch corrects that.  With the rise
> of SFINAE-based template dispatch, this can lead us to select the wrong
> template; and even in the absence of SFINAE I don't see much point in
> this permissiveness, especially since we weren't even giving a pedwarn
> for it.

I have no love of this extension, but doesn't the fact that we weren't
warning increase the chance that we'll break a lot of code with this
change?  Especially given that we even had tests that depended on it?
Without question, in our stricter mode we should reject this code, but
should we try to make it keep working with -fpermissive?

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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