@@ -762,13 +762,10 @@ void CheckHelper::CheckObjectEntity(
762762 }
763763 if (auto ignoreTKR{GetIgnoreTKR (symbol)}; !ignoreTKR.empty ()) {
764764 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) {
772769 messages_.Say (
773770 " !DIR$ IGNORE_TKR may apply only in an interface or a module procedure" _err_en_US);
774771 }
@@ -779,7 +776,7 @@ void CheckHelper::CheckObjectEntity(
779776 }
780777 if (IsPassedViaDescriptor (symbol)) {
781778 if (IsAllocatableOrObjectPointer (&symbol)) {
782- if (inExplicitInterface ) {
779+ if (inExplicitExternalInterface ) {
783780 if (context_.ShouldWarn (common::UsageWarning::IgnoreTKRUsage)) {
784781 WarnIfNotInModuleFile (
785782 " !DIR$ IGNORE_TKR should not apply to an allocatable or pointer" _warn_en_US);
@@ -794,7 +791,7 @@ void CheckHelper::CheckObjectEntity(
794791 WarnIfNotInModuleFile (
795792 " !DIR$ IGNORE_TKR(R) is not meaningful for an assumed-rank array" _warn_en_US);
796793 }
797- } else if (inExplicitInterface ) {
794+ } else if (inExplicitExternalInterface ) {
798795 if (context_.ShouldWarn (common::UsageWarning::IgnoreTKRUsage)) {
799796 WarnIfNotInModuleFile (
800797 " !DIR$ IGNORE_TKR(R) should not apply to a dummy argument passed via descriptor" _warn_en_US);
0 commit comments