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

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Thu Dec 25 11:08:31 PST 2025


================
@@ -464,6 +464,13 @@ evaluate::Expr<evaluate::SubscriptInteger> AnalyzeKindSelector(
     SemanticsContext &, common::TypeCategory,
     const std::optional<parser::KindSelector> &);
 
+void NoteUsedSymbols(SemanticsContext &, const SomeExpr &);
----------------
klausler wrote:

Objects in COMMON or EQUIVALENCE are ignored for these warnings (see code and new test).

`ALLOCATE(..., SOURCE=)` and `MOVE_ALLOC` count as uses, as does an appearance in an output-list.  `STAT=` is a definition.  I'll extend the new test to check for these.

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


More information about the flang-commits mailing list