This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH to require real lvalues in expressions
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 28 Sep 2010 07:23:56 -0700
- Subject: Re: C++ PATCH to require real lvalues in expressions
- References: <4CA0FD49.2090608@redhat.com>
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