Skip to content

Commit be6818e

Browse files
kazutakahirataGroverkss
authored andcommitted
[flang] Fix warnings
This patch fixes: flang/lib/Semantics/check-omp-structure.cpp:979:24: error: unused variable 'top' [-Werror,-Wunused-variable] flang/lib/Semantics/check-omp-structure.cpp:4441:24: error: unused variable 'top' [-Werror,-Wunused-variable]
1 parent f04fecd commit be6818e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

flang/lib/Semantics/check-omp-structure.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -976,8 +976,8 @@ void OmpStructureChecker::Leave(const parser::OpenMPLoopConstruct &x) {
976976
dirContext_.pop_back();
977977

978978
assert(!loopStack_.empty() && "Expecting non-empty loop stack");
979-
const LoopConstruct &top{loopStack_.back()};
980979
#ifndef NDEBUG
980+
const LoopConstruct &top{loopStack_.back()};
981981
auto *loopc{std::get_if<const parser::OpenMPLoopConstruct *>(&top)};
982982
assert(loopc != nullptr && *loopc == &x && "Mismatched loop constructs");
983983
#endif
@@ -4438,8 +4438,8 @@ void OmpStructureChecker::Enter(const parser::DoConstruct &x) {
44384438

44394439
void OmpStructureChecker::Leave(const parser::DoConstruct &x) {
44404440
assert(!loopStack_.empty() && "Expecting non-empty loop stack");
4441-
const LoopConstruct &top = loopStack_.back();
44424441
#ifndef NDEBUG
4442+
const LoopConstruct &top = loopStack_.back();
44434443
auto *doc{std::get_if<const parser::DoConstruct *>(&top)};
44444444
assert(doc != nullptr && *doc == &x && "Mismatched loop constructs");
44454445
#endif

0 commit comments

Comments
 (0)