Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion flang/lib/Semantics/resolve-directives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,7 @@ void OmpAttributeVisitor::ResolveOmpName(
} else if (ompFlag == Symbol::Flag::OmpCriticalLock) {
// Create a new symbol.
const auto pair{GetContext().scope.try_emplace(
name.source, Attrs{}, UnknownDetails{})};
name.source, Attrs{}, MiscDetails::Kind::ConstructName)};
CHECK(pair.second);
name.symbol = &pair.first->second.get();
}
Expand Down
18 changes: 18 additions & 0 deletions flang/test/Semantics/critical05.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenmp
! XFAIL: *
!Checking for name collision of a critical construct with other elements of a program

!DEF: /check_symbols MainProgram
program check_symbols
!DEF: /check_symbols/i ObjectEntity INTEGER(4)
integer i, bar
!REF: /check_symbols/i
foo: do i = 1, 10
end do foo

!$omp critical (foo)
!$omp end critical (foo)

!$omp critical (bar)
!$omp end critical (bar)
end program check_symbols