mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-02 05:50:26 +08:00
* gcc.dg/array-7.c, gcc.dg/c99-tag-2.c: New tests.
From-SVN: r85479
This commit is contained in:
parent
029277b7c7
commit
7a1f75f1b7
@ -1,3 +1,7 @@
|
||||
2004-08-03 Joseph S. Myers <jsm@polyomino.org.uk>
|
||||
|
||||
* gcc.dg/array-7.c, gcc.dg/c99-tag-2.c: New tests.
|
||||
|
||||
2004-08-03 Joseph S. Myers <jsm@polyomino.org.uk>
|
||||
|
||||
* gcc.dg/20001023-1.c, gcc.dg/20001108-1.c, gcc.dg/20001117-1.c,
|
||||
|
14
gcc/testsuite/gcc.dg/array-7.c
Normal file
14
gcc/testsuite/gcc.dg/array-7.c
Normal file
@ -0,0 +1,14 @@
|
||||
/* Test for array of incomplete structure type - Zack Weinberg in
|
||||
<http://gcc.gnu.org/ml/gcc-patches/2004-08/msg00108.html>. */
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "" } */
|
||||
|
||||
struct foo;
|
||||
|
||||
void
|
||||
f (void)
|
||||
{
|
||||
struct foo { int a; int b; };
|
||||
}
|
||||
|
||||
struct foo array[5]; /* { dg-error "storage size" } */
|
16
gcc/testsuite/gcc.dg/c99-tag-2.c
Normal file
16
gcc/testsuite/gcc.dg/c99-tag-2.c
Normal file
@ -0,0 +1,16 @@
|
||||
/* Test for handling of tags. A struct defined in an inner scope does
|
||||
not match one declared in an outer scope. */
|
||||
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
|
||||
|
||||
struct s;
|
||||
struct t { struct s *p; } x;
|
||||
|
||||
void
|
||||
f (void)
|
||||
{
|
||||
/* This is a different struct s from the outer one. */
|
||||
struct s { int a; } y;
|
||||
x.p = &y; /* { dg-error "incompatible" } */
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user