Skip to content

Commit decf027

Browse files
authored
[Flang][OpenMP][Semantics] Modify errors to warnings for semantic checks in IS_DEVICE_PTR related to list-items being dummy arguments. (#74370)
Changed semantic check from giving error to giving a warning about deprecation from OpenMP 5.2 and later about checks for dummy argument list-items present on IS_DEVICE_PTR clause. This P is blocker for #71255
1 parent 3c6efe5 commit decf027

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

flang/lib/Semantics/check-omp-structure.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2996,11 +2996,14 @@ void OmpStructureChecker::Enter(const parser::OmpClause::IsDevicePtr &x) {
29962996
source.ToString());
29972997
} else if (!(IsDummy(*symbol))) {
29982998
context_.Say(itr->second->source,
2999-
"Variable '%s' in IS_DEVICE_PTR clause must be a dummy argument"_err_en_US,
2999+
"Variable '%s' in IS_DEVICE_PTR clause must be a dummy argument. "
3000+
"This semantic check is deprecated from OpenMP 5.2 and later."_warn_en_US,
30003001
source.ToString());
30013002
} else if (IsAllocatableOrPointer(*symbol) || IsValue(*symbol)) {
30023003
context_.Say(itr->second->source,
3003-
"Variable '%s' in IS_DEVICE_PTR clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute."_err_en_US,
3004+
"Variable '%s' in IS_DEVICE_PTR clause must be a dummy argument "
3005+
"that does not have the ALLOCATABLE, POINTER or VALUE attribute. "
3006+
"This semantic check is deprecated from OpenMP 5.2 and later."_warn_en_US,
30043007
source.ToString());
30053008
}
30063009
}

flang/test/Semantics/OpenMP/target01.f90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@ subroutine bar(b1, b2, b3)
3939
type(c_ptr), pointer :: b2
4040
type(c_ptr), value :: b3
4141

42-
!ERROR: Variable 'c' in IS_DEVICE_PTR clause must be a dummy argument
42+
!WARNING: Variable 'c' in IS_DEVICE_PTR clause must be a dummy argument. This semantic check is deprecated from OpenMP 5.2 and later.
4343
!$omp target is_device_ptr(c)
4444
y = y + 1
4545
!$omp end target
46-
!ERROR: Variable 'b1' in IS_DEVICE_PTR clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute.
46+
!WARNING: Variable 'b1' in IS_DEVICE_PTR clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute. This semantic check is deprecated from OpenMP 5.2 and later.
4747
!$omp target is_device_ptr(b1)
4848
y = y + 1
4949
!$omp end target
50-
!ERROR: Variable 'b2' in IS_DEVICE_PTR clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute.
50+
!WARNING: Variable 'b2' in IS_DEVICE_PTR clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute. This semantic check is deprecated from OpenMP 5.2 and later.
5151
!$omp target is_device_ptr(b2)
5252
y = y + 1
5353
!$omp end target
54-
!ERROR: Variable 'b3' in IS_DEVICE_PTR clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute.
54+
!WARNING: Variable 'b3' in IS_DEVICE_PTR clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute. This semantic check is deprecated from OpenMP 5.2 and later.
5555
!$omp target is_device_ptr(b3)
5656
y = y + 1
5757
!$omp end target

0 commit comments

Comments
 (0)