[flang-commits] [flang] [flang] Fix -Wopen-mp-* and -Wopen-acc-* flag spellings (PR #188434)

via flang-commits flang-commits at lists.llvm.org
Wed Mar 25 01:48:17 PDT 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-flang-driver

@llvm/pr-subscribers-flang-openmp

Author: Michael Klemm (mjklemm)

<details>
<summary>Changes</summary>

The CamelCase-to-hyphenated conversion was incorrectly splitting "OpenMP" and "OpenACC" into "open-mp" and "open-acc", producing wrong -W flag names like -Wopen-mp-usage instead of -Wopenmp-usage. Fix the conversion to treat these as compound names, keep the old spellings as deprecated aliases, and emit a warning when deprecated spellings are used.

---

Patch is 45.01 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/188434.diff


22 Files Affected:

- (modified) flang/include/flang/Support/Fortran-features.h (+15) 
- (modified) flang/lib/Frontend/CompilerInvocation.cpp (+12) 
- (modified) flang/lib/Support/Fortran-features.cpp (+70-6) 
- (added) flang/test/Driver/deprecated-w-spelling.f90 (+17) 
- (modified) flang/test/Semantics/OpenACC/acc-declare-validity.f90 (+1-1) 
- (modified) flang/test/Semantics/OpenMP/allocate-align01.f90 (+1-1) 
- (modified) flang/test/Semantics/OpenMP/allocate01.f90 (+1-1) 
- (modified) flang/test/Semantics/OpenMP/clause-validity01.f90 (+2-2) 
- (modified) flang/test/Semantics/OpenMP/declarative-directive01.f90 (+4-4) 
- (modified) flang/test/Semantics/OpenMP/declare-target01.f90 (+13-13) 
- (modified) flang/test/Semantics/OpenMP/declare-target02.f90 (+15-15) 
- (modified) flang/test/Semantics/OpenMP/declare-target06.f90 (+1-1) 
- (modified) flang/test/Semantics/OpenMP/deprecation.f90 (+6-6) 
- (modified) flang/test/Semantics/OpenMP/nested-target.f90 (+7-7) 
- (modified) flang/test/Semantics/OpenMP/requires04.f90 (+1-1) 
- (modified) flang/test/Semantics/OpenMP/requires05.f90 (+1-1) 
- (modified) flang/test/Semantics/OpenMP/simd-aligned.f90 (+2-2) 
- (modified) flang/test/Semantics/OpenMP/single03.f90 (+1-1) 
- (modified) flang/test/Semantics/OpenMP/single04.f90 (+6-6) 
- (modified) flang/test/Semantics/OpenMP/target01.f90 (+4-4) 
- (modified) flang/test/Semantics/OpenMP/use_device_ptr1.f90 (+1-1) 
- (modified) flang/unittests/Common/FortranFeaturesTest.cpp (+4-4) 


``````````diff
diff --git a/flang/include/flang/Support/Fortran-features.h b/flang/include/flang/Support/Fortran-features.h
index f2bd0d21f25b6..10a901b8cb5c2 100644
--- a/flang/include/flang/Support/Fortran-features.h
+++ b/flang/include/flang/Support/Fortran-features.h
@@ -148,6 +148,19 @@ class LanguageFeatureControl {
   void AddAlternativeCliSpelling(UsageWarning w, std::string input) {
     cliOptions_.insert({input, {w}});
   }
+  void AddDeprecatedCliSpelling(
+      LanguageFeature f, std::string deprecated, std::string canonical) {
+    cliOptions_.insert({deprecated, {f}});
+    deprecatedCliOptions_.insert({std::move(deprecated), std::move(canonical)});
+  }
+  void AddDeprecatedCliSpelling(
+      UsageWarning w, std::string deprecated, std::string canonical) {
+    cliOptions_.insert({deprecated, {w}});
+    deprecatedCliOptions_.insert({std::move(deprecated), std::move(canonical)});
+  }
+  // Returns the canonical spelling if the input is a deprecated spelling.
+  std::optional<std::string_view> GetCanonicalSpelling(
+      std::string_view input) const;
   void ReplaceCliCanonicalSpelling(LanguageFeature f, std::string input);
   void ReplaceCliCanonicalSpelling(UsageWarning w, std::string input);
   std::string_view getDefaultCliSpelling(LanguageFeature f) const {
@@ -164,6 +177,8 @@ class LanguageFeatureControl {
   // Map from Cli syntax of language features and usage warnings to their enum
   // values.
   std::unordered_map<std::string, LanguageFeatureOrWarning> cliOptions_;
+  // Map from deprecated Cli spellings to their canonical replacements.
+  std::unordered_map<std::string, std::string> deprecatedCliOptions_;
   // These two arrays map the enum values to their cannonical Cli spellings.
   // Since each of the CanonicalSpelling is a string in the domain of the map
   // above we just use a view of the string instead of another copy.
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index 36791201825ce..5462289b30f77 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -1048,6 +1048,18 @@ static bool parseDiagArgs(CompilerInvocation &res, llvm::opt::ArgList &args,
         const unsigned diagID = diags.getCustomDiagID(
             clang::DiagnosticsEngine::Error, "Unknown diagnostic option: -W%0");
         diags.Report(diagID) << wArg;
+      } else {
+        if (auto canonical{features.GetCanonicalSpelling(wArg)}) {
+          std::string suggestion{*canonical};
+          if (wArg.size() > 3 &&
+              wArg.substr(0, 3) == "no-") {
+            suggestion = "no-" + suggestion;
+          }
+          const unsigned diagID = diags.getCustomDiagID(
+              clang::DiagnosticsEngine::Warning,
+              "-W%0 is deprecated; use -W%1 instead");
+          diags.Report(diagID) << wArg << suggestion;
+        }
       }
     }
   }
diff --git a/flang/lib/Support/Fortran-features.cpp b/flang/lib/Support/Fortran-features.cpp
index 4201f0b9b1e49..18616fdb2fb35 100644
--- a/flang/lib/Support/Fortran-features.cpp
+++ b/flang/lib/Support/Fortran-features.cpp
@@ -11,6 +11,7 @@
 #include "flang/Parser/characters.h"
 #include "flang/Support/Fortran.h"
 #include <string>
+#include <cstring>
 #include <string_view>
 
 namespace Fortran::common {
@@ -35,6 +36,26 @@ static std::vector<std::string_view> SplitCamelCase(std::string_view x) {
   return result;
 }
 
+// Compound names whose hyphenated CamelCase splitting is wrong.
+// Each entry maps the incorrect (deprecated) hyphenated form produced by
+// SplitCamelCase to the correct (canonical) form.
+static constexpr std::pair<std::string_view, std::string_view>
+    compoundNameFixups[]{{"open-mp", "openmp"}, {"open-acc", "openacc"}};
+
+// Replace all occurrences of 'from' with 'to' in 's', but only when the
+// match is at a word boundary (end of string or followed by '-') to avoid
+// e.g. "open-access" -> "openaccess".
+static void ReplaceAtWordBoundary(
+    std::string &s, std::string_view from, std::string_view to) {
+  for (size_t pos = s.find(from); pos != std::string::npos;
+      pos = s.find(from, pos + to.size())) {
+    size_t end = pos + from.size();
+    if (end == s.size() || s[end] == '-') {
+      s.replace(pos, from.size(), to);
+    }
+  }
+}
+
 // Namespace for helper functions for parsing Cli options used instead of static
 // so that there can be unit tests for this function.
 namespace details {
@@ -47,6 +68,10 @@ std::string CamelCaseToLowerCaseHyphenated(std::string_view x) {
     result += i == 0 ? "" : "-";
     result += word;
   }
+  // Fix known compound names that should not be hyphen-separated.
+  for (auto [deprecated, canonical] : compoundNameFixups) {
+    ReplaceAtWordBoundary(result, deprecated, canonical);
+  }
   return result;
 }
 } // namespace details
@@ -70,12 +95,38 @@ LanguageFeatureControl::LanguageFeatureControl() {
         std::move(cliOption);
   });
 
-  // Fix CLI spellings where the auto-generated hyphenation is wrong.
-  // TODO: -Wopen-mp-* should be fixed in a central place.  See
-  // see Discourse at
-  // https://discourse.llvm.org/t/openmp-misspelling-of-wopen-mp/90196.
-  ReplaceCliCanonicalSpelling(LanguageFeature::OpenMPThreadprivateEquivalence,
-      "openmp-threadprivate-equivalence");
+  // Register deprecated "open-mp-*" and "open-acc-*" spellings as aliases.
+  // The canonical spellings are now "openmp-*" and "openacc-*".
+  auto makeDeprecatedSpelling = [](std::string_view canonical) {
+    std::string deprecated{canonical};
+    bool replaced{false};
+    for (auto [deprecatedForm, canonicalForm] : compoundNameFixups) {
+      // Reverse direction: canonical -> deprecated.
+      for (auto pos{deprecated.find(canonicalForm)};
+          pos != std::string::npos;
+          pos = deprecated.find(canonicalForm, pos + deprecatedForm.size())) {
+        deprecated.replace(pos, canonicalForm.size(), deprecatedForm);
+        replaced = true;
+      }
+    }
+    return std::pair{deprecated, replaced};
+  };
+  ForEachLanguageFeature([&](auto feature) {
+    std::string_view canonical{
+        languageFeatureCliCanonicalSpelling_[EnumToInt(feature)]};
+    auto [deprecated, replaced]{makeDeprecatedSpelling(canonical)};
+    if (replaced) {
+      AddDeprecatedCliSpelling(feature, deprecated, std::string{canonical});
+    }
+  });
+  ForEachUsageWarning([&](auto warning) {
+    std::string_view canonical{
+        usageWarningCliCanonicalSpelling_[EnumToInt(warning)]};
+    auto [deprecated, replaced]{makeDeprecatedSpelling(canonical)};
+    if (replaced) {
+      AddDeprecatedCliSpelling(warning, deprecated, std::string{canonical});
+    }
+  });
 
   // These features must be explicitly enabled by command line options.
   disable_.set(LanguageFeature::OldDebugLines);
@@ -178,6 +229,19 @@ std::optional<LanguageControlFlag> LanguageFeatureControl::FindWarning(
   return std::nullopt;
 }
 
+std::optional<std::string_view> LanguageFeatureControl::GetCanonicalSpelling(
+    std::string_view input) const {
+  // Strip "no-" prefix for lookup, same as FindWarning does.
+  if (input.size() > 3 && input.substr(0, 3) == "no-") {
+    input = input.substr(3);
+  }
+  if (auto it{deprecatedCliOptions_.find(std::string{input})};
+      it != deprecatedCliOptions_.end()) {
+    return it->second;
+  }
+  return std::nullopt;
+}
+
 bool LanguageFeatureControl::EnableWarning(std::string_view input) {
   if (auto warningAndEnabled{FindWarning(input)}) {
     EnableWarning(warningAndEnabled->first, warningAndEnabled->second);
diff --git a/flang/test/Driver/deprecated-w-spelling.f90 b/flang/test/Driver/deprecated-w-spelling.f90
new file mode 100644
index 0000000000000..673cf98b0d236
--- /dev/null
+++ b/flang/test/Driver/deprecated-w-spelling.f90
@@ -0,0 +1,17 @@
+! Test that the deprecated -Wopen-mp-* and -Wopen-acc-* spellings produce
+! deprecation warnings and suggest the canonical -Wopenmp-* / -Wopenacc-*
+! spellings.
+
+! RUN: %flang_fc1 -fsyntax-only -Wopen-mp-usage %s 2>&1 | FileCheck --allow-empty --check-prefix=DEPRECATED %s
+! RUN: %flang_fc1 -fsyntax-only -Wno-open-mp-usage %s 2>&1 | FileCheck --allow-empty --check-prefix=DEPRECATED-NO %s
+! RUN: %flang_fc1 -fsyntax-only -Wopen-acc-usage %s 2>&1 | FileCheck --allow-empty --check-prefix=DEPRECATED-ACC %s
+! RUN: %flang_fc1 -fsyntax-only -Wopenmp-usage %s 2>&1 | FileCheck --allow-empty --check-prefix=CANONICAL %s
+! RUN: %flang_fc1 -fsyntax-only -Wopenacc-usage %s 2>&1 | FileCheck --allow-empty --check-prefix=CANONICAL %s
+
+! DEPRECATED: warning: -Wopen-mp-usage is deprecated; use -Wopenmp-usage instead
+! DEPRECATED-NO: warning: -Wno-open-mp-usage is deprecated; use -Wno-openmp-usage instead
+! DEPRECATED-ACC: warning: -Wopen-acc-usage is deprecated; use -Wopenacc-usage instead
+! CANONICAL-NOT: deprecated
+
+program test
+end program test
diff --git a/flang/test/Semantics/OpenACC/acc-declare-validity.f90 b/flang/test/Semantics/OpenACC/acc-declare-validity.f90
index 5ee61fac0660a..3e40c964b002e 100644
--- a/flang/test/Semantics/OpenACC/acc-declare-validity.f90
+++ b/flang/test/Semantics/OpenACC/acc-declare-validity.f90
@@ -14,7 +14,7 @@ module openacc_declare_validity
 
   !$acc declare create(aa, bb)
 
-  !WARNING: 'aa' in the CREATE clause is already present in the same clause in this module [-Wopen-acc-usage]
+  !WARNING: 'aa' in the CREATE clause is already present in the same clause in this module [-Wopenacc-usage]
   !$acc declare create(aa)
 
   !$acc declare link(ab)
diff --git a/flang/test/Semantics/OpenMP/allocate-align01.f90 b/flang/test/Semantics/OpenMP/allocate-align01.f90
index 4a1e60cf73fff..337353463fa25 100644
--- a/flang/test/Semantics/OpenMP/allocate-align01.f90
+++ b/flang/test/Semantics/OpenMP/allocate-align01.f90
@@ -11,7 +11,7 @@ program allocate_align_tree
     integer :: z, t, xx
     t = 2
     z = 3
-    !WARNING: The executable form of the OpenMP ALLOCATE directive has been deprecated, please use ALLOCATORS instead [-Wopen-mp-usage]
+    !WARNING: The executable form of the OpenMP ALLOCATE directive has been deprecated, please use ALLOCATORS instead [-Wopenmp-usage]
     !ERROR: Must be a constant value
 !$omp allocate(j) align(xx)
     !ERROR: The alignment should be positive
diff --git a/flang/test/Semantics/OpenMP/allocate01.f90 b/flang/test/Semantics/OpenMP/allocate01.f90
index 5fe4efdd106d9..f445ea3a030a4 100644
--- a/flang/test/Semantics/OpenMP/allocate01.f90
+++ b/flang/test/Semantics/OpenMP/allocate01.f90
@@ -19,7 +19,7 @@ subroutine sema()
     !$omp allocate(y)
     print *, a
 
-    !WARNING: The executable form of the OpenMP ALLOCATE directive has been deprecated, please use ALLOCATORS instead [-Wopen-mp-usage]
+    !WARNING: The executable form of the OpenMP ALLOCATE directive has been deprecated, please use ALLOCATORS instead [-Wopenmp-usage]
     !$omp allocate(x) allocator(omp_default_mem_alloc)
       allocate ( x(a), darray(a, b) )
     end subroutine sema
diff --git a/flang/test/Semantics/OpenMP/clause-validity01.f90 b/flang/test/Semantics/OpenMP/clause-validity01.f90
index 9371a2fc6fd58..fba9f4ac75fa1 100644
--- a/flang/test/Semantics/OpenMP/clause-validity01.f90
+++ b/flang/test/Semantics/OpenMP/clause-validity01.f90
@@ -483,14 +483,14 @@
 ! 2.13.1 master
 
   !$omp parallel
-  !WARNING: OpenMP directive MASTER has been deprecated, please use MASKED instead. [-Wopen-mp-usage]
+  !WARNING: OpenMP directive MASTER has been deprecated, please use MASKED instead. [-Wopenmp-usage]
   !$omp master
   a=3.14
   !$omp end master
   !$omp end parallel
 
   !$omp parallel
-  !WARNING: OpenMP directive MASTER has been deprecated, please use MASKED instead. [-Wopen-mp-usage]
+  !WARNING: OpenMP directive MASTER has been deprecated, please use MASKED instead. [-Wopenmp-usage]
   !ERROR: NUM_THREADS clause is not allowed on the MASTER directive
   !$omp master num_threads(4)
   a=3.14
diff --git a/flang/test/Semantics/OpenMP/declarative-directive01.f90 b/flang/test/Semantics/OpenMP/declarative-directive01.f90
index 9e6e6021ffab2..c213d0ae7a6f2 100644
--- a/flang/test/Semantics/OpenMP/declarative-directive01.f90
+++ b/flang/test/Semantics/OpenMP/declarative-directive01.f90
@@ -56,10 +56,10 @@ module m2
 contains
   subroutine foo
     !$omp declare target
-    !WARNING: The entity with PARAMETER attribute is used in a DECLARE TARGET directive [-Wopen-mp-usage]
-    !WARNING: The entity with PARAMETER attribute is used in a DECLARE TARGET directive [-Wopen-mp-usage]
+    !WARNING: The entity with PARAMETER attribute is used in a DECLARE TARGET directive [-Wopenmp-usage]
+    !WARNING: The entity with PARAMETER attribute is used in a DECLARE TARGET directive [-Wopenmp-usage]
     !$omp declare target (foo, N, M)
-    !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage]
+    !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopenmp-usage]
     !ERROR: A variable that appears in a DECLARE TARGET directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly
     !ERROR: A variable that appears in a DECLARE TARGET directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly
     !ERROR: A variable that appears in a DECLARE TARGET directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly
@@ -68,7 +68,7 @@ subroutine foo
     !ERROR: A variable that appears in a DECLARE TARGET directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly
     !ERROR: A variable that appears in a DECLARE TARGET directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly
     !$omp declare target enter(Q, S) link(R)
-    !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage]
+    !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopenmp-usage]
     !ERROR: A variable that appears in a DECLARE TARGET directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly
     !ERROR: MAP clause is not allowed on the DECLARE TARGET directive
     !$omp declare target to(Q) map(from:Q)
diff --git a/flang/test/Semantics/OpenMP/declare-target01.f90 b/flang/test/Semantics/OpenMP/declare-target01.f90
index 9e9510d57c098..9bbd66ad5ec43 100644
--- a/flang/test/Semantics/OpenMP/declare-target01.f90
+++ b/flang/test/Semantics/OpenMP/declare-target01.f90
@@ -51,84 +51,84 @@ module declare_target01
   !ERROR: A type parameter inquiry cannot appear on the DECLARE TARGET directive
   !$omp declare target (y%KIND)
 
-  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage]
+  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopenmp-usage]
   !$omp declare target to (my_var)
 
   !$omp declare target enter (my_var)
 
-  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage]
+  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopenmp-usage]
   !$omp declare target to (my_var) device_type(host)
 
   !$omp declare target enter (my_var) device_type(host)
 
   !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the DECLARE TARGET directive
-  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage]
+  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopenmp-usage]
   !$omp declare target to (my_var%t_i)
 
   !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the DECLARE TARGET directive
   !$omp declare target enter (my_var%t_i)
 
   !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the DECLARE TARGET directive
-  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage]
+  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopenmp-usage]
   !$omp declare target to (my_var%t_arr)
 
   !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the DECLARE TARGET directive
   !$omp declare target enter (my_var%t_arr)
 
   !ERROR: A type parameter inquiry cannot appear on the DECLARE TARGET directive
-  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage]
+  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopenmp-usage]
   !$omp declare target to (my_var%kind_param)
 
   !ERROR: A type parameter inquiry cannot appear on the DECLARE TARGET directive
   !$omp declare target enter (my_var%kind_param)
 
   !ERROR: A type parameter inquiry cannot appear on the DECLARE TARGET directive
-  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage]
+  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopenmp-usage]
   !$omp declare target to (my_var%len_param)
 
   !ERROR: A type parameter inquiry cannot appear on the DECLARE TARGET directive
   !$omp declare target enter (my_var%len_param)
 
-  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage]
+  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopenmp-usage]
   !$omp declare target to (arr)
 
   !$omp declare target enter (arr)
 
-  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage]
+  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopenmp-usage]
   !$omp declare target to (arr) device_type(nohost)
 
   !$omp declare target enter (arr) device_type(nohost)
 
   !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the DECLARE TARGET directive
-  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage]
+  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopenmp-usage]
   !$omp declare target to (arr(1))
 
   !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the DECLARE TARGET directive
   !$omp declare target enter (arr(1))
 
   !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the DECLARE TARGET directive
-  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage]
+  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopenmp-usage]
   !$omp declare target to (arr(1:2))
 
   !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the DECLARE TARGET directive
   !$omp declare target enter (arr(1:2))
 
   !ERROR: A type parameter inquiry cannot appear on the DECLARE TARGET directive
-  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage]
+  !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopenmp-usage]
   !$omp declare target to (x%KIND)
 
   !ERROR: A type parameter inquiry cannot appear on the DECLARE TARGET directive
   !$omp declare target enter (x%KIND)
 
   !ERROR: A type parameter inquiry cannot appear on the DECLARE TARGET directive
-  !WARNING: The usage of TO clause on DECLARE TARGET directive has ...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/188434


More information about the flang-commits mailing list