This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++, diagnostic, obvious?] Typo in fix for PR 35058
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Cc: Gabriel Dos Reis <gdr at cs dot tamu dot edu>, Manuel López-I báñez <lopezibanez at gmail dot com>
- Date: Wed, 28 Jan 2009 20:32:39 +0100
- Subject: [C++, diagnostic, obvious?] Typo in fix for PR 35058
Hi Manuel, Gaby, all,
yesterday, while looking into something else I noticed this change in
the cp/typeck.c changes of r138089 (the fix for PR 35058):
- if (! lvalue_p (arg) && (pedantic || complain == tf_none))
+ if (! lvalue_p (arg) && complain == tf_none)
{
if (complain & tf_error)
permerror ("ISO C++ forbids taking the address of a cast to a non-lvalue expression");
else
return error_mark_node;
which certainly looks very strange and inconsistent with the other
changes in the same patch. I'm pretty sure the below was really
intended, I'm tempted to commit it as obvious, but I'll wait a couple of
days, to be sure...
Tested x86_64-linux.
Paolo.
////////////////////
2009-01-28 Paolo Carlini <paolo.carlini@oracle.com>
* typeck.c (cp_build_unary_op): Fix typo in fix for PR 35058.
Index: typeck.c
===================================================================
*** typeck.c (revision 143738)
--- typeck.c (working copy)
*************** cp_build_unary_op (enum tree_code code,
*** 4555,4561 ****
/* Even if we're not being pedantic, we cannot allow this
extension when we're instantiating in a SFINAE
context. */
! if (! lvalue_p (arg) && complain == tf_none)
{
if (complain & tf_error)
permerror (input_location, "ISO C++ forbids taking the address of a cast to a non-lvalue expression");
--- 4555,4561 ----
/* Even if we're not being pedantic, we cannot allow this
extension when we're instantiating in a SFINAE
context. */
! if (! lvalue_p (arg))
{
if (complain & tf_error)
permerror (input_location, "ISO C++ forbids taking the address of a cast to a non-lvalue expression");