]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Ensure OpenMP reduction with reference type references complete type [PR101516]
authorJakub Jelinek <jakub@redhat.com>
Wed, 21 Jul 2021 07:38:59 +0000 (09:38 +0200)
committerJakub Jelinek <jakub@redhat.com>
Wed, 21 Jul 2021 08:07:00 +0000 (10:07 +0200)
commitae2ce6aadbfd211162b4232e413f9fc2ba873cb4
tree8076d5e8ec5bb7b15d0d10da0fb8d3b9c86e50b0
parent70e5a8ffdef6524fdc1115a410b285f5bced5bcc
c++: Ensure OpenMP reduction with reference type references complete type [PR101516]

The following testcase ICEs because we haven't verified if reduction decl
has reference type that TREE_TYPE of the reference is a complete type,
require_complete_type on the decl doesn't ensure that.

2021-07-21  Jakub Jelinek  <jakub@redhat.com>

PR c++/101516
* semantics.c (finish_omp_reduction_clause): Also call
complete_type_or_else and return true if it fails.

* g++.dg/gomp/pr101516.C: New test.

(cherry picked from commit aea199f96cf116ba4c81426207acde371556610c)
gcc/cp/semantics.c
gcc/testsuite/g++.dg/gomp/pr101516.C [new file with mode: 0644]