diff options
author | Joseph Myers <joseph@codesourcery.com> | 2009-02-03 20:38:12 +0000 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2009-02-03 20:38:12 +0000 |
commit | f6294de75a14a23135eafbe422ad6696e9484982 (patch) | |
tree | 9a5ac59c0878e4d7dc874eff3d31ec3dd883ecbf /gcc/testsuite | |
parent | 1056e649deaff4bfffa57ae501163167c39c6c97 (diff) | |
download | gcc-f6294de75a14a23135eafbe422ad6696e9484982.zip gcc-f6294de75a14a23135eafbe422ad6696e9484982.tar.gz gcc-f6294de75a14a23135eafbe422ad6696e9484982.tar.bz2 |
re PR c/35433 (ICE with typeof and ternary operator)
PR c/35433
* c-typeck.c (composite_type): Set TYPE_SIZE and TYPE_SIZE_UNIT
for composite type involving a zero-length array type.
testsuite:
* gcc.dg/init-bad-6.c: New test.
From-SVN: r143906
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/init-bad-6.c | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1df4e70..20d0b4a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-02-03 Joseph Myers <joseph@codesourcery.com> + + PR c/35433 + * gcc.dg/init-bad-6.c: New test. + 2009-02-03 Jakub Jelinek <jakub@redhat.com> PR target/35318 diff --git a/gcc/testsuite/gcc.dg/init-bad-6.c b/gcc/testsuite/gcc.dg/init-bad-6.c new file mode 100644 index 0000000..8235f5d --- /dev/null +++ b/gcc/testsuite/gcc.dg/init-bad-6.c @@ -0,0 +1,12 @@ +/* ICE arising from bug computing composite type of zero-length array + types: PR 35433. */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +typedef int* X; +typedef int* Y; + +X (*p)[][0]; +Y (*q)[][0]; + +typeof(*(0 ? p : q)) x = { 0 }; /* { dg-warning "excess elements in array initializer|near initialization" } */ |