c: Avoid clobbering TREE_TYPE (error_mark_node) [PR99990]
authorJakub Jelinek <jakub@redhat.com>
Sat, 10 Apr 2021 15:01:54 +0000 (17:01 +0200)
committerJakub Jelinek <jakub@redhat.com>
Sat, 10 Apr 2021 15:01:54 +0000 (17:01 +0200)
commit9f7d77bd6d65aa1cf2e195d3776052705c6e636b
tree432dd2899823346bfeafa314486c445e3c5ef9a8
parent0344b5b822b310921a432b9ffcb9ea0b3964820d
c: Avoid clobbering TREE_TYPE (error_mark_node) [PR99990]

The following testcase ICEs during error recovery, because finish_decl
overwrites TREE_TYPE (error_mark_node), which better should stay always
to be error_mark_node.

2021-04-10  Jakub Jelinek  <jakub@redhat.com>

PR c/99990
* c-decl.c (finish_decl): Don't overwrite TREE_TYPE of
error_mark_node.

* gcc.dg/pr99990.c: New test.
gcc/c/c-decl.c
gcc/testsuite/gcc.dg/pr99990.c [new file with mode: 0644]