File tree Expand file tree Collapse file tree 3 files changed +22
-6
lines changed
Expand file tree Collapse file tree 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) {
26482648 llvm::omp::Directive dir{GetContext ().directive };
26492649 unsigned version{context_.langOptions ().OpenMPVersion };
26502650 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+ }
26562666 }
26572667 }
26582668}
Original file line number Diff line number Diff line change @@ -23,6 +23,6 @@ subroutine f02
2323subroutine f03
2424 integer :: obj, jbo
2525! 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
2727 ! $omp depobj(obj) destroy(jbo)
2828end
Original file line number Diff line number Diff line change @@ -13,3 +13,9 @@ subroutine f03
1313! ERROR: The DESTROY clause must refer to the same object as the DEPOBJ construct
1414 ! $omp depobj(obj) destroy(jbo)
1515end
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