[flang-commits] [flang] [flang][warnings] systematically guard warnings (PR #154234)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Tue Aug 19 08:47:39 PDT 2025


================
@@ -677,13 +672,9 @@ class CheckSpecificationExprHelper
     } else if (isInitialized &&
         context_.languageFeatures().IsEnabled(
             common::LanguageFeature::SavedLocalInSpecExpr)) {
-      if (!scope_.IsModuleFile() &&
-          context_.languageFeatures().ShouldWarn(
-              common::LanguageFeature::SavedLocalInSpecExpr)) {
-        context_.messages().Say(common::LanguageFeature::SavedLocalInSpecExpr,
-            "specification expression refers to local object '%s' (initialized and saved)"_port_en_US,
-            ultimate.name());
-      }
+      context_.Warn(common::LanguageFeature::SavedLocalInSpecExpr,
----------------
klausler wrote:

This is going to emit the warning even for a module file.

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


More information about the flang-commits mailing list