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]

[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");

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