]> git.ipfire.org Git - thirdparty/gcc.git/commit
openmp: Don't ICE on detach clause with erroneous decl [PR98742]
authorJakub Jelinek <jakub@redhat.com>
Wed, 20 Jan 2021 07:35:20 +0000 (08:35 +0100)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Fri, 22 Jan 2021 16:35:02 +0000 (08:35 -0800)
commit668dc081cccaf5c44e31fe39e741d5644a300bb1
tree82c42f11e6cd3d35a31e7de63257a6b2af3a18f7
parentd4d00bc2f8fa2b130e50145db385fecf5858c845
openmp: Don't ICE on detach clause with erroneous decl [PR98742]

Similarly to how we handle erroneous operands to e.g. allocate clause,
this change just removes those clauses instead of accessing TYPE_MAIN_VARIANT
of its type, which doesn't work on error_mark_node.  Also, just for good
measure, bails out if TYPE_NAME is NULL.

2021-01-20  Jakub Jelinek  <jakub@redhat.com>

PR c++/98742
* semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
error_operand_p, remove clause without further checking.  Check
for non-NULL TYPE_NAME.

* c-c++-common/gomp/task-detach-2.c: New test.

(cherry picked from commit 7ab1abf3b82a3bcfff9b7bc596166fef6a0d83ab)
gcc/cp/ChangeLog.omp
gcc/cp/semantics.c
gcc/testsuite/ChangeLog.omp
gcc/testsuite/c-c++-common/gomp/task-detach-2.c [new file with mode: 0644]