Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions flang/lib/Semantics/resolve-names.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1661,9 +1661,11 @@ class OmpVisitor : public virtual DeclarationVisitor {
}
bool Pre(const parser::OpenMPDeclarativeConstruct &x) {
AddOmpSourceRange(x.source);
SkipImplicitTyping(true);
return true;
}
void Post(const parser::OpenMPDeclarativeConstruct &) {
SkipImplicitTyping(false);
messageHandler().set_currStmtSource(std::nullopt);
}
bool Pre(const parser::OpenMPDepobjConstruct &x) {
Expand Down
12 changes: 12 additions & 0 deletions flang/test/Semantics/OpenMP/declare-simd-linear.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! Test declare simd with linear clause

module mod
contains
subroutine test(i)
!$omp declare simd linear(i:1)
implicit none
integer*8 i
i=i+2
end subroutine
end module
2 changes: 0 additions & 2 deletions flang/test/Semantics/OpenMP/linear-clause01.f90
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ subroutine linear_clause_02(arg_01, arg_02)
!$omp declare simd linear(uval(arg_02))
integer, value, intent(in) :: arg_02

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

Expand Down