This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] fix gcc.dg/func-ptr-conv-1.c failure
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, iant at google dot com
- Date: Wed, 17 Jun 2009 08:59:09 -0400
- Subject: [patch] fix gcc.dg/func-ptr-conv-1.c failure
With Ian's patch here:
http://gcc.gnu.org/ml/gcc-patches/2009-06/msg00198.html
The location for COND_EXPRs now point to the colon in a conditional
expression. I had originally assumed that COND_EXPRs were anchored at
the question mark, but it really doesn't matter, insofar as we're
consistent.
The diagnostics branch made the wrong assumption wrt COND_EXPRs. This
patch fixes the problem.
Applied as obvious.
This fixes 3 of the 7 failures in PR40435. The other failures in the PR
are unrelated to this fix. I will look at them next.
Aldy
* gcc.dg/func-ptr-conv-1.c: Update column info.
Index: testsuite/gcc.dg/func-ptr-conv-1.c
===================================================================
--- testsuite/gcc.dg/func-ptr-conv-1.c (revision 148490)
+++ testsuite/gcc.dg/func-ptr-conv-1.c (working copy)
@@ -37,8 +37,8 @@ g(void)
fp = c5; /* { dg-warning "6:pointer" "bad conversion" } */
fp = (void (*)(void))v5; /* { dg-warning "8:pointer" "bad conversion" } */
fp = (void (*)(void))c5; /* { dg-warning "8:pointer" "bad conversion" } */
- (a ? f : v3); /* { dg-warning "6:pointer" "bad conversion" } */
- (a ? v2 : fp); /* { dg-warning "6:pointer" "bad conversion" } */
+ (a ? f : v3); /* { dg-warning "10:pointer" "bad conversion" } */
+ (a ? v2 : fp); /* { dg-warning "11:pointer" "bad conversion" } */
/* The following are OK. */
fp = 0;
fp = (void *)0;