Skip to content

Commit 71925f7

Browse files
committed
Fix tests, re-enable implicit typing in Post, handle DeclarativeConstructs
1 parent 6a60b05 commit 71925f7

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

flang/lib/Semantics/resolve-names.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,6 +1516,9 @@ class OmpVisitor : public virtual DeclarationVisitor {
15161516
SkipImplicitTyping(true);
15171517
return true;
15181518
}
1519+
void Post(const parser::OpenMPDeclareSimdConstruct &x) {
1520+
SkipImplicitTyping(false);
1521+
}
15191522

15201523
bool Pre(const parser::OmpInitializerProc &x) {
15211524
auto &procDes = std::get<parser::ProcedureDesignator>(x.t);
@@ -1662,9 +1665,11 @@ class OmpVisitor : public virtual DeclarationVisitor {
16621665
}
16631666
bool Pre(const parser::OpenMPDeclarativeConstruct &x) {
16641667
AddOmpSourceRange(x.source);
1668+
SkipImplicitTyping(true);
16651669
return true;
16661670
}
16671671
void Post(const parser::OpenMPDeclarativeConstruct &) {
1672+
SkipImplicitTyping(false);
16681673
messageHandler().set_currStmtSource(std::nullopt);
16691674
}
16701675
bool Pre(const parser::OpenMPDepobjConstruct &x) {

flang/test/Semantics/OpenMP/declare-simd-linear.f90

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,10 @@
33

44
module mod
55
contains
6-
subroutine sub(m,i)
6+
subroutine test(i)
77
!$omp declare simd linear(i:1)
88
implicit none
9-
integer*8 i,n
10-
value i
11-
parameter(n=10000)
12-
real*4 a,b,m
13-
common/com1/a(n)
14-
common/com2/b(n)
15-
a(i) = b(i) + m
9+
integer*8 i
1610
i=i+2
1711
end subroutine
1812
end module

flang/test/Semantics/OpenMP/linear-clause01.f90

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ subroutine linear_clause_02(arg_01, arg_02)
2424
!$omp declare simd linear(uval(arg_02))
2525
integer, value, intent(in) :: arg_02
2626

27-
!ERROR: The list item 'var' specified without the REF 'linear-modifier' must be of INTEGER type
2827
!ERROR: If the `linear-modifier` is REF or UVAL, the list item 'var' must be a dummy argument without the VALUE attribute
2928
!ERROR: The list item `var` must be a dummy argument
3029
!ERROR: The list item `var` in a LINEAR clause must not be Cray Pointer or a variable with POINTER attribute
3130
!$omp declare simd linear(uval(var))
32-
!ERROR: The type of 'var' has already been implicitly declared
3331
integer, pointer :: var
3432
end subroutine linear_clause_02
3533

0 commit comments

Comments
 (0)