diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-03-01 19:27:21 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-03-01 19:27:21 +0100 |
commit | 686e2237f31bd26851e3c8f9a528ab30aef16c54 (patch) | |
tree | 1a91ba6e3c49bf4883cb532528943c10ee28f01d /gcc/testsuite/gcc.dg | |
parent | f8e4188cae89ff679d23534601759b5c38a41c6f (diff) | |
download | gcc-686e2237f31bd26851e3c8f9a528ab30aef16c54.zip gcc-686e2237f31bd26851e3c8f9a528ab30aef16c54.tar.gz gcc-686e2237f31bd26851e3c8f9a528ab30aef16c54.tar.bz2 |
re PR c/69796 (ICE on invalid code in useless_type_conversion_p, at gimple-expr.c:83)
PR c/69796
PR c/69974
* c-parser.c (c_parser_translation_unit): Don't change TREE_TYPE
of incomplete decls to error_mark_node.
* gcc.dg/pr69796.c: New test.
* gcc.dg/pr69974.c: New test.
From-SVN: r233861
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr69796.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr69974.c | 13 |
2 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr69796.c b/gcc/testsuite/gcc.dg/pr69796.c new file mode 100644 index 0000000..ebf34aa --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr69796.c @@ -0,0 +1,10 @@ +/* PR c/69796 */ +/* { dg-do compile } */ + +struct S s; /* { dg-error "storage size of 's' isn't known" } */ + +void +foo () +{ + s a; /* { dg-error "expression statement has incomplete type|expected" } */ +} diff --git a/gcc/testsuite/gcc.dg/pr69974.c b/gcc/testsuite/gcc.dg/pr69974.c new file mode 100644 index 0000000..101d621 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr69974.c @@ -0,0 +1,13 @@ +/* PR c/69974 */ +/* { dg-do compile } */ + +struct S; +char foo (struct S *); +struct S a; /* { dg-error "storage size of 'a' isn't known" } */ +int b; + +void +bar () +{ + b &= foo (&a); +} |