Skip to content

Commit 5225901

Browse files
authored
[flang] Add [[maybe_unused]] to fix -Werror build (#83456)
Add the [[maybe_unused]] attribute to a variable in lib/Lower/OpenMP/OpenMP.cpp to avoid a (possibly bogus) unused variable warning when building with GCC 9.3.0.
1 parent 75fb825 commit 5225901

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

flang/lib/Lower/OpenMP/OpenMP.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,8 @@ genEnterExitUpdateDataOp(Fortran::lower::AbstractConverter &converter,
840840
llvm::SmallVector<mlir::Attribute> dependTypeOperands;
841841

842842
Fortran::parser::OmpIfClause::DirectiveNameModifier directiveName;
843-
llvm::omp::Directive directive;
843+
// GCC 9.3.0 emits a (probably) bogus warning about an unused variable.
844+
[[maybe_unused]] llvm::omp::Directive directive;
844845
if constexpr (std::is_same_v<OpTy, mlir::omp::EnterDataOp>) {
845846
directiveName =
846847
Fortran::parser::OmpIfClause::DirectiveNameModifier::TargetEnterData;

0 commit comments

Comments
 (0)