@@ -502,13 +502,14 @@ static void CheckExplicitDataArg(const characteristics::DummyDataObject &dummy,
502
502
}
503
503
504
504
static void CheckProcedureArg (evaluate::ActualArgument &arg,
505
- const characteristics::DummyProcedure &proc, const std::string &dummyName,
505
+ const characteristics::Procedure &proc,
506
+ const characteristics::DummyProcedure &dummy, const std::string &dummyName,
506
507
evaluate::FoldingContext &context) {
507
508
parser::ContextualMessages &messages{context.messages ()};
508
- const characteristics::Procedure &interface{proc .procedure .value ()};
509
+ const characteristics::Procedure &interface { dummy .procedure .value () };
509
510
if (const auto *expr{arg.UnwrapExpr ()}) {
510
511
bool dummyIsPointer{
511
- proc .attrs .test (characteristics::DummyProcedure::Attr::Pointer)};
512
+ dummy .attrs .test (characteristics::DummyProcedure::Attr::Pointer)};
512
513
const auto *argProcDesignator{
513
514
std::get_if<evaluate::ProcedureDesignator>(&expr->u )};
514
515
const auto *argProcSymbol{
@@ -549,6 +550,10 @@ static void CheckProcedureArg(evaluate::ActualArgument &arg,
549
550
" Actual procedure argument has interface incompatible with %s" _err_en_US,
550
551
dummyName);
551
552
return ;
553
+ } else if (proc.IsPure ()) {
554
+ messages.Say (
555
+ " Actual procedure argument for %s of a PURE procedure must have an explicit interface" _err_en_US,
556
+ dummyName);
552
557
} else {
553
558
messages.Say (
554
559
" Actual procedure argument has an implicit interface "
@@ -594,7 +599,7 @@ static void CheckProcedureArg(evaluate::ActualArgument &arg,
594
599
}
595
600
}
596
601
if (interface.HasExplicitInterface () && dummyIsPointer &&
597
- proc .intent != common::Intent::In) {
602
+ dummy .intent != common::Intent::In) {
598
603
const Symbol *last{GetLastSymbol (*expr)};
599
604
if (!(last && IsProcedurePointer (*last))) {
600
605
// 15.5.2.9(5) -- dummy procedure POINTER
@@ -661,8 +666,8 @@ static void CheckExplicitInterfaceArg(evaluate::ActualArgument &arg,
661
666
}
662
667
}
663
668
},
664
- [&](const characteristics::DummyProcedure &proc ) {
665
- CheckProcedureArg (arg, proc, dummyName, context);
669
+ [&](const characteristics::DummyProcedure &dummy ) {
670
+ CheckProcedureArg (arg, proc, dummy, dummyName, context);
666
671
},
667
672
[&](const characteristics::AlternateReturn &) {
668
673
// All semantic checking is done elsewhere
0 commit comments