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]

Re: [PATCH] Fix PR c/12446


> If you don't *need* to change a testcase to accommodate changed error
> messages, then doing so is dubious; rather keep the testcase testing
> exactly what it was testing before (whatever that might be).  In this case
> the testcases allowed multiple possible messages, which should cover both
> the old and the new.

Ok.

> The dg-options line should have -pedantic-errors - all the conformance
> tests do except for a few where it's specifically being tested that
> -std=whatever should suffice for valid code to be accepted without any
> further options.

Here are the new testcases. Tested with

  make -k check-gcc RUNTESTFLAGS="dg.exp=c9?-array-lval*"

giving 66 expected passes.


2003-10-03  Eric Botcazou  <ebotcazou@libertysurf.fr>

        * gcc.dg/c90-array-lval-6.c: New test.
        * gcc.dg/c99-array-lval-6.c: New test.

-- 
Eric Botcazou
/* PR c/12446 */
/* Origin: Keith Thompson <kst@cts.com> */

/* { dg-do compile } */
/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */


struct s { char c[1]; };

extern struct s foo(void);

void bar(void)
{
  char *ptr = foo().c; /* { dg-bogus "warning" "warning in place of error" } */
}
/* { dg-error "non-lvalue" "array not decaying to lvalue" { target *-*-* } 14 } */
/* PR c/12446 */
/* Origin: Keith Thompson <kst@cts.com> */

/* { dg-do compile } */
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */


struct s { char c[1]; };

extern struct s foo(void);

void bar(void)
{
  char *ptr = foo().c; /* { dg-bogus "non-lvalue" "array not decaying to lvalue" } */
}

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