[flang-commits] [flang] [flang] Add new warnings for unused & undefined locals (PR #173504)

Eugene Epshteyn via flang-commits flang-commits at lists.llvm.org
Tue Dec 30 16:23:30 PST 2025


================
@@ -7501,7 +7501,12 @@ Symbol *DeclarationVisitor::DeclareStatementEntity(
       SayAlreadyDeclared(name, *prev);
       return nullptr;
     }
-    name.symbol = nullptr;
+    // Inhibit diagnostics about an unused local symbol here,
+    // since one may well have been declared solely to determine the
+    // type of an implied DO index.  Some compilers don't yet support
+    // an explicit "integer(k)::" in an implied DO.
+    context().NoteUsedSymbol(*prev);
----------------
eugeneepshteyn wrote:

Thank you :-)

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


More information about the flang-commits mailing list