This revision was automatically updated to reflect the committed changes.
Closed by commit rC335911: [OPENMP] Fix incomplete type check for array 
reductions (authored by jdenny, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D48735?vs=153366&id=153374#toc

Repository:
  rC Clang

https://reviews.llvm.org/D48735

Files:
  lib/Sema/SemaOpenMP.cpp
  test/OpenMP/parallel_reduction_messages.c


Index: lib/Sema/SemaOpenMP.cpp
===================================================================
--- lib/Sema/SemaOpenMP.cpp
+++ lib/Sema/SemaOpenMP.cpp
@@ -10335,7 +10335,7 @@
     // OpenMP [2.9.3.3, Restrictions, C/C++, p.3]
     //  A variable that appears in a private clause must not have an incomplete
     //  type or a reference type.
-    if (S.RequireCompleteType(ELoc, Type,
+    if (S.RequireCompleteType(ELoc, D->getType(),
                               diag::err_omp_reduction_incomplete_type))
       continue;
     // OpenMP [2.14.3.6, reduction clause, Restrictions]
Index: test/OpenMP/parallel_reduction_messages.c
===================================================================
--- test/OpenMP/parallel_reduction_messages.c
+++ test/OpenMP/parallel_reduction_messages.c
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s
+
+int incomplete[];
+
+void test() {
+#pragma omp parallel reduction(+ : incomplete) // expected-error {{a reduction 
list item with incomplete type 'int []'}}
+  ;
+}
+
+// complete to suppress an additional warning, but it's too late for pragmas
+int incomplete[3];


Index: lib/Sema/SemaOpenMP.cpp
===================================================================
--- lib/Sema/SemaOpenMP.cpp
+++ lib/Sema/SemaOpenMP.cpp
@@ -10335,7 +10335,7 @@
     // OpenMP [2.9.3.3, Restrictions, C/C++, p.3]
     //  A variable that appears in a private clause must not have an incomplete
     //  type or a reference type.
-    if (S.RequireCompleteType(ELoc, Type,
+    if (S.RequireCompleteType(ELoc, D->getType(),
                               diag::err_omp_reduction_incomplete_type))
       continue;
     // OpenMP [2.14.3.6, reduction clause, Restrictions]
Index: test/OpenMP/parallel_reduction_messages.c
===================================================================
--- test/OpenMP/parallel_reduction_messages.c
+++ test/OpenMP/parallel_reduction_messages.c
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s
+
+int incomplete[];
+
+void test() {
+#pragma omp parallel reduction(+ : incomplete) // expected-error {{a reduction list item with incomplete type 'int []'}}
+  ;
+}
+
+// complete to suppress an additional warning, but it's too late for pragmas
+int incomplete[3];
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to