summaryrefslogtreecommitdiff
path: root/flang/lib/Evaluate/fold-logical.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'flang/lib/Evaluate/fold-logical.cpp')
-rw-r--r--flang/lib/Evaluate/fold-logical.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/flang/lib/Evaluate/fold-logical.cpp b/flang/lib/Evaluate/fold-logical.cpp
index 6950caf32741..c64f79e06a8a 100644
--- a/flang/lib/Evaluate/fold-logical.cpp
+++ b/flang/lib/Evaluate/fold-logical.cpp
@@ -530,13 +530,11 @@ static Expr<Type<TypeCategory::Logical, KIND>> RewriteOutOfRange(
if (args.size() >= 3) {
// Bounds depend on round= value
if (auto *round{UnwrapExpr<Expr<SomeType>>(args[2])}) {
- if (const Symbol * whole{UnwrapWholeSymbolDataRef(*round)};
- whole && semantics::IsOptional(whole->GetUltimate()) &&
- context.languageFeatures().ShouldWarn(
- common::UsageWarning::OptionalMustBePresent)) {
+ if (const Symbol *whole{UnwrapWholeSymbolDataRef(*round)};
+ whole && semantics::IsOptional(whole->GetUltimate())) {
if (auto source{args[2]->sourceLocation()}) {
- context.messages().Say(
- common::UsageWarning::OptionalMustBePresent, *source,
+ context.Warn(common::UsageWarning::OptionalMustBePresent,
+ *source,
"ROUND= argument to OUT_OF_RANGE() is an optional dummy argument that must be present at execution"_warn_en_US);
}
}