Skip to content

Commit 3fbc03c

Browse files
committed
Improve the fix
1 parent c095c84 commit 3fbc03c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

flang/lib/Semantics/resolve-directives.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2516,11 +2516,11 @@ void OmpAttributeVisitor::ResolveOmpObject(
25162516
}
25172517
if (ompFlag == Symbol::Flag::OmpDeclareTarget) {
25182518
if (symbol->IsFuncResult()) {
2519-
if (Scope * container{&currScope()}) {
2520-
if (Symbol * func{container->symbol()}) {
2521-
func->set(ompFlag);
2522-
name->symbol = func;
2523-
}
2519+
if (Symbol * func{currScope().symbol()}) {
2520+
assert(func->IsSubprogram() &&
2521+
"Expecting function scope");
2522+
func->set(ompFlag);
2523+
name->symbol = func;
25242524
}
25252525
}
25262526
}

0 commit comments

Comments
 (0)