[flang] Accept OPEN(ACCESS='APPEND') legacy extension even without warnings enabled

My earlier patch to accept ACCESS='APPEND' only worked when warnings
were enabled; fix it.

Differential Revision: https://reviews.llvm.org/D102653
This commit is contained in:
peter klausler 2021-05-17 14:10:02 -07:00
parent e81334a754
commit 8cd199b85f
1 changed files with 6 additions and 4 deletions

View File

@ -833,10 +833,12 @@ void IoChecker::CheckStringValue(IoSpecKind specKind, const std::string &value,
};
auto upper{parser::ToUpperCaseLetters(value)};
if (specValues.at(specKind).count(upper) == 0) {
if (specKind == IoSpecKind::Access && upper == "APPEND" &&
context_.languageFeatures().ShouldWarn(
common::LanguageFeature::OpenAccessAppend)) {
context_.Say(source, "ACCESS='%s' interpreted as POSITION='%s'"_en_US, value, upper);
if (specKind == IoSpecKind::Access && upper == "APPEND") {
if (context_.languageFeatures().ShouldWarn(
common::LanguageFeature::OpenAccessAppend)) {
context_.Say(source, "ACCESS='%s' interpreted as POSITION='%s'"_en_US,
value, upper);
}
} else {
context_.Say(source, "Invalid %s value '%s'"_err_en_US,
parser::ToUpperCaseLetters(common::EnumToString(specKind)), value);