Skip to content

Commit ba489ed

Browse files
Don't create extra scode at the entry to DATA statement:
modified: lib/Semantics/resolve-names.cpp Adjusted the test to the new behavior of implied-DO loops in DATA statements: modified: test/Semantics/resolve40.f90
1 parent ae9886a commit ba489ed

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

flang/lib/Semantics/resolve-names.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7521,9 +7521,9 @@ bool ConstructVisitor::Pre(const parser::DataStmtObject &x) {
75217521
}
75227522
},
75237523
[&](const parser::DataImpliedDo &y) {
7524-
PushScope(Scope::Kind::ImpliedDos, nullptr);
7524+
// Don't push scope here, since it's done when visiting
7525+
// DataImpliedDo.
75257526
Walk(y);
7526-
PopScope();
75277527
},
75287528
},
75297529
x.u);

flang/test/Semantics/resolve40.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ subroutine s8
6969

7070
subroutine s9
7171
real :: x(2,2)
72-
!ERROR: 'i' is already declared in this scoping unit
73-
data ((x(i,i),i=1,2),i=1,2)/4*0.0/
72+
! Nested implied DO loops have their own scope
73+
data ((x(i,j),j=1,2),(x(i,j),j=1,2),i=1,2)/8*0.0/
7474
end
7575

7676
module m10

0 commit comments

Comments
 (0)