Skip to content

Commit 3f1d0e1

Browse files
authored
[flang] Silence warning in module file (#107421)
Most warnings should be silenced when processing the content of a module file, since the warning should have also appeared when the module file was generated. The case of an intrinsic type kind not being supported for a target wasn't being suppressed; fix. Fixes #107337.
1 parent 1892666 commit 3f1d0e1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

flang/lib/Semantics/expression.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4027,7 +4027,8 @@ bool ExpressionAnalyzer::CheckIntrinsicKind(
40274027
return true;
40284028
} else if (foldingContext_.targetCharacteristics().CanSupportType(
40294029
category, kind)) {
4030-
if (context_.ShouldWarn(common::UsageWarning::BadTypeForTarget)) {
4030+
if (context_.ShouldWarn(common::UsageWarning::BadTypeForTarget) &&
4031+
!context_.IsInModuleFile(GetContextualMessages().at())) {
40314032
Say("%s(KIND=%jd) is not an enabled type for this target"_warn_en_US,
40324033
ToUpperCase(EnumToString(category)), kind);
40334034
}

0 commit comments

Comments
 (0)