File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -1946,7 +1946,11 @@ void OmpAttributeVisitor::Post(const parser::Name &name) {
1946
1946
if (Symbol * found{currScope ().FindSymbol (name.source )}) {
1947
1947
if (symbol != found) {
1948
1948
name.symbol = found; // adjust the symbol within region
1949
- } else if (GetContext ().defaultDSA == Symbol::Flag::OmpNone) {
1949
+ } else if (GetContext ().defaultDSA == Symbol::Flag::OmpNone &&
1950
+ // Exclude indices of sequential loops that are privatised in
1951
+ // the scope of the parallel region, and not in this scope.
1952
+ // TODO: check whether this should be caught in IsObjectWithDSA
1953
+ !symbol->test (Symbol::Flag::OmpPrivate)) {
1950
1954
context_.Say (name.source ,
1951
1955
" The DEFAULT(NONE) clause requires that '%s' must be listed in "
1952
1956
" a data-sharing attribute clause" _err_en_US,
Original file line number Diff line number Diff line change @@ -17,7 +17,20 @@ subroutine default_none()
17
17
! $omp end parallel
18
18
end subroutine default_none
19
19
20
+ ! Test that indices of sequential loops are privatised and hence do not error
21
+ ! for DEFAULT(NONE)
22
+ subroutine default_none_seq_loop
23
+ integer :: i
24
+
25
+ ! $omp parallel do default(none)
26
+ do i = 1 , 10
27
+ do j = 1 , 20
28
+ enddo
29
+ enddo
30
+ end subroutine
31
+
20
32
program mm
21
33
call default_none()
34
+ call default_none_seq_loop()
22
35
! TODO: private, firstprivate, shared
23
36
end
You can’t perform that action at this time.
0 commit comments