File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4427,8 +4427,17 @@ bool ExpressionAnalyzer::CheckIntrinsicKind(
44274427 return true ;
44284428 } else if (foldingContext_.targetCharacteristics ().CanSupportType (
44294429 category, kind)) {
4430- Say (" %s(KIND=%jd) is not an enabled type for this target" _err_en_US,
4431- ToUpperCase (EnumToString (category)), kind);
4430+ if (const semantics::Scope *modFileScope{
4431+ semantics::FindModuleFileContaining (
4432+ context_.FindScope (GetContextualMessages ().at ()))};
4433+ modFileScope && modFileScope->parent ().IsIntrinsicModules ()) {
4434+ // Ignore usage of unsupported intrinsic type kinds in intrinsic module
4435+ // files. They might be USE'd into a cross-compilation or into a
4436+ // compilation with a disabled REAL kind.
4437+ } else {
4438+ Say (" %s(KIND=%jd) is not an enabled type for this target" _err_en_US,
4439+ ToUpperCase (EnumToString (category)), kind);
4440+ }
44324441 return true ;
44334442 } else {
44344443 Say (" %s(KIND=%jd) is not a supported type" _err_en_US,
Original file line number Diff line number Diff line change 1+ ! RUN: flang -c -Xflang -fdisable-real-10 %s 2>&1 | FileCheck --allow-empty %s
2+ ! REQUIRES: x86-registered-target
3+ ! CHECK-NOT: error
4+ ! Ensure ieee_arithmetic.mod can be used even when REAL(10) is disabled.
5+ use ieee_arithmetic
6+ end
You can’t perform that action at this time.
0 commit comments