@@ -145,12 +145,15 @@ static void CheckExplicitDataArg(const characteristics::DummyDataObject &dummy,
145
145
const std::string &dummyName, evaluate::Expr<evaluate::SomeType> &actual,
146
146
characteristics::TypeAndShape &actualType, bool isElemental,
147
147
evaluate::FoldingContext &context, const Scope *scope,
148
- const evaluate::SpecificIntrinsic *intrinsic) {
148
+ const evaluate::SpecificIntrinsic *intrinsic,
149
+ bool allowIntegerConversions) {
149
150
150
151
// Basic type & rank checking
151
152
parser::ContextualMessages &messages{context.messages ()};
152
153
PadShortCharacterActual (actual, dummy.type , actualType, context, messages);
153
- ConvertIntegerActual (actual, dummy.type , actualType, messages);
154
+ if (allowIntegerConversions) {
155
+ ConvertIntegerActual (actual, dummy.type , actualType, messages);
156
+ }
154
157
bool typesCompatible{dummy.type .type ().IsTkCompatibleWith (actualType.type ())};
155
158
if (typesCompatible) {
156
159
if (isElemental) {
@@ -631,7 +634,8 @@ static void CheckProcedureArg(evaluate::ActualArgument &arg,
631
634
static void CheckExplicitInterfaceArg (evaluate::ActualArgument &arg,
632
635
const characteristics::DummyArgument &dummy,
633
636
const characteristics::Procedure &proc, evaluate::FoldingContext &context,
634
- const Scope *scope, const evaluate::SpecificIntrinsic *intrinsic) {
637
+ const Scope *scope, const evaluate::SpecificIntrinsic *intrinsic,
638
+ bool allowIntegerConversions) {
635
639
auto &messages{context.messages ()};
636
640
std::string dummyName{" dummy argument" };
637
641
if (!dummy.name .empty ()) {
@@ -646,7 +650,8 @@ static void CheckExplicitInterfaceArg(evaluate::ActualArgument &arg,
646
650
arg.set_dummyIntent (object.intent );
647
651
bool isElemental{object.type .Rank () == 0 && proc.IsElemental ()};
648
652
CheckExplicitDataArg (object, dummyName, *expr, *type,
649
- isElemental, context, scope, intrinsic);
653
+ isElemental, context, scope, intrinsic,
654
+ allowIntegerConversions);
650
655
} else if (object.type .type ().IsTypelessIntrinsicArgument () &&
651
656
IsBOZLiteral (*expr)) {
652
657
// ok
@@ -779,7 +784,8 @@ static bool CheckElementalConformance(parser::ContextualMessages &messages,
779
784
static parser::Messages CheckExplicitInterface (
780
785
const characteristics::Procedure &proc, evaluate::ActualArguments &actuals,
781
786
const evaluate::FoldingContext &context, const Scope *scope,
782
- const evaluate::SpecificIntrinsic *intrinsic) {
787
+ const evaluate::SpecificIntrinsic *intrinsic,
788
+ bool allowIntegerConversions) {
783
789
parser::Messages buffer;
784
790
parser::ContextualMessages messages{context.messages ().at (), &buffer};
785
791
RearrangeArguments (proc, actuals, messages);
@@ -789,8 +795,8 @@ static parser::Messages CheckExplicitInterface(
789
795
for (auto &actual : actuals) {
790
796
const auto &dummy{proc.dummyArguments .at (index++)};
791
797
if (actual) {
792
- CheckExplicitInterfaceArg (
793
- *actual, dummy, proc, localContext, scope, intrinsic );
798
+ CheckExplicitInterfaceArg (*actual, dummy, proc, localContext, scope,
799
+ intrinsic, allowIntegerConversions );
794
800
} else if (!dummy.IsOptional ()) {
795
801
if (dummy.name .empty ()) {
796
802
messages.Say (
@@ -815,13 +821,15 @@ static parser::Messages CheckExplicitInterface(
815
821
parser::Messages CheckExplicitInterface (const characteristics::Procedure &proc,
816
822
evaluate::ActualArguments &actuals, const evaluate::FoldingContext &context,
817
823
const Scope &scope, const evaluate::SpecificIntrinsic *intrinsic) {
818
- return CheckExplicitInterface (proc, actuals, context, &scope, intrinsic);
824
+ return CheckExplicitInterface (
825
+ proc, actuals, context, &scope, intrinsic, true );
819
826
}
820
827
821
828
bool CheckInterfaceForGeneric (const characteristics::Procedure &proc,
822
- evaluate::ActualArguments &actuals,
823
- const evaluate::FoldingContext &context) {
824
- return !CheckExplicitInterface (proc, actuals, context, nullptr , nullptr )
829
+ evaluate::ActualArguments &actuals, const evaluate::FoldingContext &context,
830
+ bool allowIntegerConversions) {
831
+ return !CheckExplicitInterface (
832
+ proc, actuals, context, nullptr , nullptr , allowIntegerConversions)
825
833
.AnyFatalError ();
826
834
}
827
835
0 commit comments