Skip to content

Commit

Permalink
[flang][openacc] Fix name resolution on routine bind clause
Browse files Browse the repository at this point in the history
Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D158120
  • Loading branch information
clementval committed Aug 16, 2023
1 parent bb5f64a commit e2f6891
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion flang/lib/Semantics/resolve-directives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ bool AccAttributeVisitor::Pre(const parser::OpenACCRoutineConstruct &x) {

bool AccAttributeVisitor::Pre(const parser::AccBindClause &x) {
if (const auto *name{std::get_if<parser::Name>(&x.u)}) {
if (!ResolveName(*name)) {
if (!ResolveName(*name, true)) {
context_.Say(name->source,
"No function or subroutine declared for '%s'"_err_en_US,
name->source);
Expand Down
4 changes: 4 additions & 0 deletions flang/test/Semantics/OpenACC/acc-routine.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ subroutine sub2(a)
real, dimension(10) :: a
call sub1(a)
end subroutine

subroutine sub3()
!$acc routine bind(sub1)
end subroutine

0 comments on commit e2f6891

Please sign in to comment.