Skip to content

Commit 74f9ab5

Browse files
clementvalrazmser
authored andcommitted
[flang][openacc] Fix name resolution on routine bind clause
Reviewed By: razvanlupusoru Differential Revision: https://reviews.llvm.org/D158120
1 parent bdad42d commit 74f9ab5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

flang/lib/Semantics/resolve-directives.cpp

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 0 deletions
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)