File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -2467,7 +2467,8 @@ void OmpAttributeVisitor::CheckDataCopyingClause(
2467
2467
// either 'private' or 'threadprivate' in enclosing context.
2468
2468
if (!checkSymbol->test (Symbol::Flag::OmpThreadprivate) &&
2469
2469
!(HasSymbolInEnclosingScope (symbol, currScope ()) &&
2470
- symbol.test (Symbol::Flag::OmpPrivate))) {
2470
+ (symbol.test (Symbol::Flag::OmpPrivate) ||
2471
+ symbol.test (Symbol::Flag::OmpFirstPrivate)))) {
2471
2472
context_.Say (name.source ,
2472
2473
" COPYPRIVATE variable '%s' is not PRIVATE or THREADPRIVATE in "
2473
2474
" outer context" _err_en_US,
Original file line number Diff line number Diff line change @@ -34,6 +34,13 @@ program omp_copyprivate
34
34
! $omp end parallel
35
35
! $omp end parallel sections
36
36
37
+ ! The use of FIRSTPRIVATE with COPYPRIVATE is allowed
38
+ ! $omp parallel firstprivate(a)
39
+ ! $omp single
40
+ a = a + k
41
+ ! $omp end single copyprivate(a)
42
+ ! $omp end parallel
43
+
37
44
print * , a, b
38
45
39
46
end program omp_copyprivate
You can’t perform that action at this time.
0 commit comments