Skip to content

Commit e2f6891

Browse files
committed
[flang][openacc] Fix name resolution on routine bind clause
Reviewed By: razvanlupusoru Differential Revision: https://reviews.llvm.org/D158120
1 parent bb5f64a commit e2f6891

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

flang/lib/Semantics/resolve-directives.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ bool AccAttributeVisitor::Pre(const parser::OpenACCRoutineConstruct &x) {
846846

847847
bool AccAttributeVisitor::Pre(const parser::AccBindClause &x) {
848848
if (const auto *name{std::get_if<parser::Name>(&x.u)}) {
849-
if (!ResolveName(*name)) {
849+
if (!ResolveName(*name, true)) {
850850
context_.Say(name->source,
851851
"No function or subroutine declared for '%s'"_err_en_US,
852852
name->source);

flang/test/Semantics/OpenACC/acc-routine.f90

+4
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ subroutine sub2(a)
99
real, dimension(10) :: a
1010
call sub1(a)
1111
end subroutine
12+
13+
subroutine sub3()
14+
!$acc routine bind(sub1)
15+
end subroutine

0 commit comments

Comments
 (0)