c: Propagate erroneous types to declaration specifiers [PR107805]
authorFlorian Weimer <fweimer@redhat.com>
Thu, 24 Nov 2022 10:00:54 +0000 (11:00 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 24 Nov 2022 10:02:11 +0000 (11:02 +0100)
commita42e39a7b974645d2820931357e99411fdb0beb6
treeb68d3acae78f411671a236cae516258ab86db532
parentec73b55c75baa16c1cf7482fa65928a8d45598d4
c: Propagate erroneous types to declaration specifiers [PR107805]

Without this change, finish_declspecs cannot tell that whether there
was an erroneous type specified, or no type at all.  This may result
in additional diagnostics for implicit ints, or missing diagnostics
for multiple types.

PR c/107805

gcc/c/
* c-decl.cc (declspecs_add_type): Propagate error_mark_bode
from type to specs.

gcc/testsuite/
* gcc.dg/pr107805-1.c: New test.
* gcc.dg/pr107805-2.c: Likewise.
gcc/c/c-decl.cc
gcc/testsuite/gcc.dg/pr107805-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr107805-2.c [new file with mode: 0644]