File tree Expand file tree Collapse file tree 3 files changed +25
-18
lines changed Expand file tree Collapse file tree 3 files changed +25
-18
lines changed Original file line number Diff line number Diff line change @@ -1290,7 +1290,6 @@ class ResolveNamesVisitor : public virtual ScopeHandler,
1290
1290
ResolveName (*parser::Unwrap<parser::Name>(x.name ));
1291
1291
}
1292
1292
void Post (const parser::ProcComponentRef &);
1293
- bool Pre (const parser::ActualArg &);
1294
1293
bool Pre (const parser::FunctionReference &);
1295
1294
bool Pre (const parser::CallStmt &);
1296
1295
bool Pre (const parser::ImportStmt &);
@@ -5317,23 +5316,6 @@ const DeclTypeSpec &ConstructVisitor::ToDeclTypeSpec(
5317
5316
5318
5317
// ResolveNamesVisitor implementation
5319
5318
5320
- // Ensures that bare undeclared intrinsic procedure names passed as actual
5321
- // arguments get recognized as being intrinsics.
5322
- bool ResolveNamesVisitor::Pre (const parser::ActualArg &arg) {
5323
- if (const auto *expr{std::get_if<Indirection<parser::Expr>>(&arg.u )}) {
5324
- if (const auto *designator{
5325
- std::get_if<Indirection<parser::Designator>>(&expr->value ().u )}) {
5326
- if (const auto *dataRef{
5327
- std::get_if<parser::DataRef>(&designator->value ().u )}) {
5328
- if (const auto *name{std::get_if<parser::Name>(&dataRef->u )}) {
5329
- NameIsKnownOrIntrinsic (*name);
5330
- }
5331
- }
5332
- }
5333
- }
5334
- return true ;
5335
- }
5336
-
5337
5319
bool ResolveNamesVisitor::Pre (const parser::FunctionReference &x) {
5338
5320
HandleCall (Symbol::Flag::Function, x.v );
5339
5321
return false ;
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ subroutine badsubr(dummy)
15
15
procedure (elem) :: dummy
16
16
end subroutine
17
17
end interface
18
+ intrinsic :: cos
18
19
call subr(cos) ! not an error
19
20
! ERROR: Non-intrinsic ELEMENTAL procedure 'elem' may not be passed as an actual argument
20
21
call subr(elem) ! C1533
@@ -35,6 +36,7 @@ elemental real function elem03(x)
35
36
real , value :: x
36
37
end function
37
38
subroutine test
39
+ intrinsic :: cos
38
40
call callme(cos) ! not an error
39
41
! ERROR: Non-intrinsic ELEMENTAL procedure 'elem01' may not be passed as an actual argument
40
42
call callme(elem01) ! C1533
@@ -65,3 +67,25 @@ subroutine test
65
67
call callee(coarray[1 ]) ! C1537
66
68
end subroutine
67
69
end module
70
+
71
+ program p03
72
+ logical :: l
73
+ call s1(index)
74
+ l = index .eq. 0 ! index is an object entity, not an intrinsic
75
+ call s2(sin)
76
+ ! ERROR: Actual argument associated with procedure dummy argument 'p=' is not a procedure
77
+ call s3(cos)
78
+ contains
79
+ subroutine s2 (x )
80
+ real :: x
81
+ end
82
+ subroutine s3 (p )
83
+ procedure (real ) :: p
84
+ end
85
+ end
86
+
87
+ program p04
88
+ implicit none
89
+ ! ERROR: No explicit type declared for 'index'
90
+ call s1(index)
91
+ end
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ function intprocptr()
43
43
end function
44
44
45
45
subroutine test1 ! 15.5.2.9(5)
46
+ intrinsic :: sin
46
47
procedure (realfunc), pointer :: p
47
48
procedure (intfunc), pointer :: ip
48
49
p = > realfunc
You can’t perform that action at this time.
0 commit comments