File tree 3 files changed +22
-6
lines changed
3 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -2648,11 +2648,21 @@ void OmpStructureChecker::Enter(const parser::OmpClause::Destroy &x) {
2648
2648
llvm::omp::Directive dir{GetContext ().directive };
2649
2649
unsigned version{context_.langOptions ().OpenMPVersion };
2650
2650
if (dir == llvm::omp::Directive::OMPD_depobj) {
2651
- if (version < 52 ) {
2652
- context_.Say (GetContext ().clauseSource ,
2653
- " The object parameter in DESTROY clause in DEPOPJ construct "
2654
- " was introduced in %s" _port_en_US,
2655
- ThisVersion (52 ));
2651
+ unsigned argSince{52 }, noargDeprecatedIn{52 };
2652
+ if (x.v ) {
2653
+ if (version < argSince) {
2654
+ context_.Say (GetContext ().clauseSource ,
2655
+ " The object parameter in DESTROY clause on DEPOPJ construct "
2656
+ " is not allowed in %s, %s" _warn_en_US,
2657
+ ThisVersion (version), TryVersion (argSince));
2658
+ }
2659
+ } else {
2660
+ if (version >= noargDeprecatedIn) {
2661
+ context_.Say (GetContext ().clauseSource ,
2662
+ " The DESTROY clause without argument on DEPOBJ construct "
2663
+ " is deprecated in %s" _warn_en_US,
2664
+ ThisVersion (noargDeprecatedIn));
2665
+ }
2656
2666
}
2657
2667
}
2658
2668
}
Original file line number Diff line number Diff line change @@ -23,6 +23,6 @@ subroutine f02
23
23
subroutine f03
24
24
integer :: obj, jbo
25
25
! ERROR: The DESTROY clause must refer to the same object as the DEPOBJ construct
26
- ! PORTABILITY : The object parameter in DESTROY clause in DEPOPJ construct was introduced in OpenMP v5.2
26
+ ! WARNING : The object parameter in DESTROY clause on DEPOPJ construct is not allowed in OpenMP v5.0, try -fopenmp-version=52
27
27
! $omp depobj(obj) destroy(jbo)
28
28
end
Original file line number Diff line number Diff line change @@ -13,3 +13,9 @@ subroutine f03
13
13
! ERROR: The DESTROY clause must refer to the same object as the DEPOBJ construct
14
14
! $omp depobj(obj) destroy(jbo)
15
15
end
16
+
17
+ subroutine f06
18
+ integer :: obj
19
+ ! WARNING: The DESTROY clause without argument on DEPOBJ construct is deprecated in OpenMP v5.2
20
+ ! $omp depobj(obj) destroy
21
+ end
You can’t perform that action at this time.
0 commit comments