Skip to content

Commit 67c5998

Browse files
committed
[flang][OpenMP] Fix symbol handling in critical constructs
Fixes llvm#78936
1 parent bb1a8bb commit 67c5998

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

flang/lib/Semantics/resolve-directives.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,6 +1823,7 @@ bool OmpAttributeVisitor::Pre(const parser::OpenMPCriticalConstruct &x) {
18231823
const auto &beginCriticalDir{std::get<parser::OmpCriticalDirective>(x.t)};
18241824
const auto &endCriticalDir{std::get<parser::OmpEndCriticalDirective>(x.t)};
18251825
PushContext(beginCriticalDir.source, llvm::omp::Directive::OMPD_critical);
1826+
GetContext().withinConstruct = true;
18261827
if (const auto &criticalName{
18271828
std::get<std::optional<parser::Name>>(beginCriticalDir.t)}) {
18281829
ResolveOmpName(*criticalName, Symbol::Flag::OmpCriticalLock);

0 commit comments

Comments
 (0)