]> gcc.gnu.org Git - gcc.git/commit
attribs: Don't diagnose attribute exclusions during error recovery [PR94705]
authorJakub Jelinek <jakub@redhat.com>
Thu, 23 Apr 2020 07:54:14 +0000 (09:54 +0200)
committerJakub Jelinek <jakub@redhat.com>
Thu, 17 Sep 2020 15:41:01 +0000 (17:41 +0200)
commit19be15e11849ab0e8587fb03f5da86fe51a176dc
treeb2d53e3b8620f29b39afcfd6b7c46766bd62de3d
parentc4f33fe9cd322455e016787c5f726b5559844f26
attribs: Don't diagnose attribute exclusions during error recovery [PR94705]

On the following testcase GCC ICEs, because last_decl is error_mark_node,
and diag_attr_exclusions assumes that if it is not NULL, it must be a decl.

The following patch just doesn't diagnose attribute exclusions if the
other decl is erroneous (and thus we've already reported errors for it).

2020-04-23  Jakub Jelinek  <jakub@redhat.com>

PR c/94705
* attribs.c (decl_attribute): Don't diagnose attribute exclusions
if last_decl is error_mark_node or has such a TREE_TYPE.

* gcc.dg/pr94705.c: New test.

(cherry picked from commit e2a71816b4949225498bec37e947293aa7f5841b)
gcc/attribs.c
gcc/testsuite/gcc.dg/pr94705.c [new file with mode: 0644]
This page took 0.057879 seconds and 6 git commands to generate.