On Thu, Jan 23, 2014 at 10:44 AM, Marek Polacek <pola...@redhat.com> wrote:
> On Thu, Jan 23, 2014 at 05:50:23PM +0000, Joseph S. Myers wrote:
>> On Thu, 23 Jan 2014, Marek Polacek wrote:
>>
>> > shorten_compare can produce a better locinfo if we pass location
>> > from {,cp_}build_binary_op to it; op0/op1 there don't have location.
>> > Furthermore, I see no reason why use input_location in
>> > parser_build_binary_op when we can use more accurate location.
>> >
>> > I don't know if/how I can test the column info using dejagnu, so
>> > no testcase attached.  But to give you an idea, instead of
>>
>> The approach used is
>>
>> /* { dg-warning "14:comparison is always false" } */
>>
>> or similar, with the column number put at the start of the dg-error /
>> dg-warning text.
>
> Argh, not sure how I missed that.  So with a testcase this time.
>
> OK now?
>
> 2014-01-23  Marek Polacek  <pola...@redhat.com>
>
>         PR c/59846
> c-family/
>         * c-common.c (shorten_compare): Add location_t parameter.
>         * c-common.h (shorten_binary_op): Adjust declaration.
> cp/
>         * typeck.c (cp_build_binary_op): Pass location to shorten_compare.
> c/
>         * c-typeck.c (parser_build_binary_op): Use location instead of
>         input_location.
>         (build_binary_op): Pass location to shorten_compare.
> testsuite/
>         * gcc.dg/pr59846.c: New test.
>

It failed on Linux/x86:

FAIL: gcc.dg/pr59846.c (test for excess errors)
FAIL: gcc.dg/pr59846.c  (test for warnings, line 14)
FAIL: gcc.dg/pr59846.c  (test for warnings, line 8)

-- 
H.J.

Reply via email to