[flang-commits] [flang] 9c1ad89 - [flang] Emit portability warning for assigned FORMAT use
Peter Klausler via flang-commits
flang-commits at lists.llvm.org
Sat Dec 3 17:38:03 PST 2022
Author: Peter Klausler
Date: 2022-12-03T16:29:17-08:00
New Revision: 9c1ad89d0e7718ba7d3a7042a16304c0591a4041
URL: https://github.com/llvm/llvm-project/commit/9c1ad89d0e7718ba7d3a7042a16304c0591a4041
DIFF: https://github.com/llvm/llvm-project/commit/9c1ad89d0e7718ba7d3a7042a16304c0591a4041.diff
LOG: [flang] Emit portability warning for assigned FORMAT use
Emit a portability warning about usage of a deprecated feature
when an I/O data transfer statement uses a scalar integer
variable as an assigned format.
Differential Revision: https://reviews.llvm.org/D139144
Added:
Modified:
flang/lib/Semantics/check-io.cpp
Removed:
################################################################################
diff --git a/flang/lib/Semantics/check-io.cpp b/flang/lib/Semantics/check-io.cpp
index ee7eb02efefa..349b34d7b811 100644
--- a/flang/lib/Semantics/check-io.cpp
+++ b/flang/lib/Semantics/check-io.cpp
@@ -231,6 +231,9 @@ void IoChecker::Enter(const parser::Format &spec) {
if (!IsVariable(*expr)) {
context_.Say(format.source,
"Assigned format label must be a scalar variable"_err_en_US);
+ } else if (context_.ShouldWarn(common::LanguageFeature::Assign)) {
+ context_.Say(format.source,
+ "Assigned format labels are deprecated"_port_en_US);
}
return;
}
More information about the flang-commits
mailing list