Skip to content

Commit e106f25

Browse files
committed
[OPENMP] Check that allocated variables are used in private clauses.
According to OpenMP 5.0 standard, 2.11.4 allocate Clause, Restrictions, For any list item that is specified in the allocate clause on a directive, a data-sharing attribute clause that may create a private copy of that list item must be specified on the same directive. Patch adds the checks for this restriction. llvm-svn: 357390
1 parent 150a7ec commit e106f25

File tree

3 files changed

+230
-131
lines changed

3 files changed

+230
-131
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9161,6 +9161,8 @@ def err_expected_allocator_clause : Error<"expected an 'allocator' clause "
91619161
def warn_omp_allocate_thread_on_task_target_directive : Warning<
91629162
"allocator with the 'thread' trait access has unspecified behavior on '%0' directive">,
91639163
InGroup<OpenMPClauses>;
9164+
def err_omp_expected_private_copy_for_allocate : Error<
9165+
"the referenced item is not found in any private clause on the same directive">;
91649166
} // end of OpenMP category
91659167

91669168
let CategoryName = "Related Result Type Issue" in {

0 commit comments

Comments
 (0)