[flang-commits] [PATCH] D155977: [flang] Emit just one warning for a bad format edit descriptor
Peter Klausler via Phabricator via flang-commits
flang-commits at lists.llvm.org
Fri Jul 21 15:17:29 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rGcfa032cea0a1: [flang] Emit just one warning for a bad format edit descriptor (authored by klausler).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D155977/new/
https://reviews.llvm.org/D155977
Files:
flang/include/flang/Common/format.h
flang/lib/Parser/io-parsers.cpp
Index: flang/lib/Parser/io-parsers.cpp
===================================================================
--- flang/lib/Parser/io-parsers.cpp
+++ flang/lib/Parser/io-parsers.cpp
@@ -601,28 +601,26 @@
"A " >> pure(format::IntrinsicTypeDataEditDesc::Kind::A), maybe(width),
noInt, noInt) ||
// PGI/Intel extension: omitting width (and all else that follows)
- extension<LanguageFeature::AbbreviatedEditDescriptor>(
- "nonstandard usage: abbreviated edit descriptor"_port_en_US,
- construct<format::IntrinsicTypeDataEditDesc>(
- "I " >> pure(format::IntrinsicTypeDataEditDesc::Kind::I) ||
- ("B "_tok / !letter /* don't occlude BN & BZ */) >>
- pure(format::IntrinsicTypeDataEditDesc::Kind::B) ||
- "O " >> pure(format::IntrinsicTypeDataEditDesc::Kind::O) ||
- "Z " >> pure(format::IntrinsicTypeDataEditDesc::Kind::Z) ||
- "F " >> pure(format::IntrinsicTypeDataEditDesc::Kind::F) ||
- ("D "_tok / !letter /* don't occlude DT, DC, & DP */) >>
- pure(format::IntrinsicTypeDataEditDesc::Kind::D) ||
- "E " >>
- ("N " >>
- pure(format::IntrinsicTypeDataEditDesc::Kind::EN) ||
- "S " >>
- pure(format::IntrinsicTypeDataEditDesc::Kind::ES) ||
- "X " >>
- pure(format::IntrinsicTypeDataEditDesc::Kind::EX) ||
- pure(format::IntrinsicTypeDataEditDesc::Kind::E)) ||
- "G " >> pure(format::IntrinsicTypeDataEditDesc::Kind::G) ||
- "L " >> pure(format::IntrinsicTypeDataEditDesc::Kind::L),
- noInt, noInt, noInt)))
+ // Parse them just to get them to the I/O checker in semantics;
+ // they are not supported by the runtime.
+ extension<LanguageFeature::AbbreviatedEditDescriptor>(construct<
+ format::IntrinsicTypeDataEditDesc>(
+ "I " >> pure(format::IntrinsicTypeDataEditDesc::Kind::I) ||
+ ("B "_tok / !letter /* don't occlude BN & BZ */) >>
+ pure(format::IntrinsicTypeDataEditDesc::Kind::B) ||
+ "O " >> pure(format::IntrinsicTypeDataEditDesc::Kind::O) ||
+ "Z " >> pure(format::IntrinsicTypeDataEditDesc::Kind::Z) ||
+ "F " >> pure(format::IntrinsicTypeDataEditDesc::Kind::F) ||
+ ("D "_tok / !letter /* don't occlude DT, DC, & DP */) >>
+ pure(format::IntrinsicTypeDataEditDesc::Kind::D) ||
+ "E " >>
+ ("N " >> pure(format::IntrinsicTypeDataEditDesc::Kind::EN) ||
+ "S " >> pure(format::IntrinsicTypeDataEditDesc::Kind::ES) ||
+ "X " >> pure(format::IntrinsicTypeDataEditDesc::Kind::EX) ||
+ pure(format::IntrinsicTypeDataEditDesc::Kind::E)) ||
+ "G " >> pure(format::IntrinsicTypeDataEditDesc::Kind::G) ||
+ "L " >> pure(format::IntrinsicTypeDataEditDesc::Kind::L),
+ noInt, noInt, noInt)))
// R1307 data-edit-desc (part 2 of 2)
// R1312 v -> [sign] digit-string
Index: flang/include/flang/Common/format.h
===================================================================
--- flang/include/flang/Common/format.h
+++ flang/include/flang/Common/format.h
@@ -471,7 +471,7 @@
NextToken();
return true;
}
- if (*argString_ != 'A') {
+ if (*argString_ != 'A' && *argString_ != 'L') {
ReportWarning("Expected '%s' edit descriptor 'w' value"); // C1306
}
return false;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155977.543091.patch
Type: text/x-patch
Size: 3599 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230721/96181f28/attachment-0001.bin>
More information about the flang-commits
mailing list