diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/semantics.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/gomp/pr101516.C | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index b97dc1f..331daf8 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -6070,7 +6070,8 @@ finish_omp_reduction_clause (tree c, bool *need_default_ctor, bool *need_dtor) if (!processing_template_decl) { t = require_complete_type (t); - if (t == error_mark_node) + if (t == error_mark_node + || !complete_type_or_else (oatype, NULL_TREE)) return true; tree size = size_binop (EXACT_DIV_EXPR, TYPE_SIZE_UNIT (oatype), TYPE_SIZE_UNIT (type)); diff --git a/gcc/testsuite/g++.dg/gomp/pr101516.C b/gcc/testsuite/g++.dg/gomp/pr101516.C new file mode 100644 index 0000000..48f60de --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/pr101516.C @@ -0,0 +1,8 @@ +// PR c++/101516 + +void +foo (int (&v) []) +{ + #pragma omp parallel reduction (+:v) // { dg-error "invalid use of array with unspecified bounds" } + ; +} |