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 07:38:59 +0000 (09:38 +0200)
commitaea199f96cf116ba4c81426207acde371556610c
tree0ee5e809cce7042bed7dee5e75f5f361f00808c5
parentb3d4011ba10275fbd5d6ec5a16d5aaebbdfb5d3c
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.
gcc/cp/semantics.c
gcc/testsuite/g++.dg/gomp/pr101516.C [new file with mode: 0644]