summaryrefslogtreecommitdiff
path: root/flang/lib/Evaluate/common.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'flang/lib/Evaluate/common.cpp')
-rw-r--r--flang/lib/Evaluate/common.cpp32
1 files changed, 14 insertions, 18 deletions
diff --git a/flang/lib/Evaluate/common.cpp b/flang/lib/Evaluate/common.cpp
index 6a960d46166e..46c75a5c2ee4 100644
--- a/flang/lib/Evaluate/common.cpp
+++ b/flang/lib/Evaluate/common.cpp
@@ -16,26 +16,22 @@ namespace Fortran::evaluate {
void RealFlagWarnings(
FoldingContext &context, const RealFlags &flags, const char *operation) {
static constexpr auto warning{common::UsageWarning::FoldingException};
- if (context.languageFeatures().ShouldWarn(warning)) {
- if (flags.test(RealFlag::Overflow)) {
- context.messages().Say(warning, "overflow on %s"_warn_en_US, operation);
- }
- if (flags.test(RealFlag::DivideByZero)) {
- if (std::strcmp(operation, "division") == 0) {
- context.messages().Say(warning, "division by zero"_warn_en_US);
- } else {
- context.messages().Say(
- warning, "division by zero on %s"_warn_en_US, operation);
- }
- }
- if (flags.test(RealFlag::InvalidArgument)) {
- context.messages().Say(
- warning, "invalid argument on %s"_warn_en_US, operation);
- }
- if (flags.test(RealFlag::Underflow)) {
- context.messages().Say(warning, "underflow on %s"_warn_en_US, operation);
+ if (flags.test(RealFlag::Overflow)) {
+ context.Warn(warning, "overflow on %s"_warn_en_US, operation);
+ }
+ if (flags.test(RealFlag::DivideByZero)) {
+ if (std::strcmp(operation, "division") == 0) {
+ context.Warn(warning, "division by zero"_warn_en_US);
+ } else {
+ context.Warn(warning, "division by zero on %s"_warn_en_US, operation);
}
}
+ if (flags.test(RealFlag::InvalidArgument)) {
+ context.Warn(warning, "invalid argument on %s"_warn_en_US, operation);
+ }
+ if (flags.test(RealFlag::Underflow)) {
+ context.Warn(warning, "underflow on %s"_warn_en_US, operation);
+ }
}
ConstantSubscript &FoldingContext::StartImpliedDo(