@@ -762,13 +762,10 @@ void CheckHelper::CheckObjectEntity(
762
762
}
763
763
if (auto ignoreTKR{GetIgnoreTKR (symbol)}; !ignoreTKR.empty ()) {
764
764
const Symbol *ownerSymbol{symbol.owner ().symbol ()};
765
- const auto *ownerSubp{ownerSymbol->detailsIf <SubprogramDetails>()};
766
- bool inInterface{ownerSubp && ownerSubp->isInterface ()};
767
- bool inExplicitInterface{
768
- inInterface && !IsSeparateModuleProcedureInterface (ownerSymbol)};
769
- bool inModuleProc{
770
- !inInterface && ownerSymbol && IsModuleProcedure (*ownerSymbol)};
771
- if (!inExplicitInterface && !inModuleProc) {
765
+ bool inModuleProc{ownerSymbol && IsModuleProcedure (*ownerSymbol)};
766
+ bool inExplicitExternalInterface{
767
+ InInterface () && !IsSeparateModuleProcedureInterface (ownerSymbol)};
768
+ if (!InInterface () && !inModuleProc) {
772
769
messages_.Say (
773
770
" !DIR$ IGNORE_TKR may apply only in an interface or a module procedure" _err_en_US);
774
771
}
@@ -779,7 +776,7 @@ void CheckHelper::CheckObjectEntity(
779
776
}
780
777
if (IsPassedViaDescriptor (symbol)) {
781
778
if (IsAllocatableOrObjectPointer (&symbol)) {
782
- if (inExplicitInterface ) {
779
+ if (inExplicitExternalInterface ) {
783
780
if (context_.ShouldWarn (common::UsageWarning::IgnoreTKRUsage)) {
784
781
WarnIfNotInModuleFile (
785
782
" !DIR$ IGNORE_TKR should not apply to an allocatable or pointer" _warn_en_US);
@@ -794,7 +791,7 @@ void CheckHelper::CheckObjectEntity(
794
791
WarnIfNotInModuleFile (
795
792
" !DIR$ IGNORE_TKR(R) is not meaningful for an assumed-rank array" _warn_en_US);
796
793
}
797
- } else if (inExplicitInterface ) {
794
+ } else if (inExplicitExternalInterface ) {
798
795
if (context_.ShouldWarn (common::UsageWarning::IgnoreTKRUsage)) {
799
796
WarnIfNotInModuleFile (
800
797
" !DIR$ IGNORE_TKR(R) should not apply to a dummy argument passed via descriptor" _warn_en_US);
0 commit comments