[flang-commits] [flang] c50de57 - [flang] Fix a warning

Kazu Hirata via flang-commits flang-commits at lists.llvm.org
Thu Dec 21 10:30:42 PST 2023


Author: Kazu Hirata
Date: 2023-12-21T10:30:36-08:00
New Revision: c50de57feb2b824d789fe3bc4e0d24c5bfc266ea

URL: https://github.com/llvm/llvm-project/commit/c50de57feb2b824d789fe3bc4e0d24c5bfc266ea
DIFF: https://github.com/llvm/llvm-project/commit/c50de57feb2b824d789fe3bc4e0d24c5bfc266ea.diff

LOG: [flang] Fix a warning

This patch fixes:

  flang/lib/Optimizer/Transforms/StackArrays.cpp:452:7: error:
  ignoring return value of function declared with 'nodiscard'
  attribute [-Werror,-Wunused-result]

Added: 
    

Modified: 
    flang/lib/Optimizer/Transforms/StackArrays.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Optimizer/Transforms/StackArrays.cpp b/flang/lib/Optimizer/Transforms/StackArrays.cpp
index b51e2aae1a9d51..1c213abefe6f5f 100644
--- a/flang/lib/Optimizer/Transforms/StackArrays.cpp
+++ b/flang/lib/Optimizer/Transforms/StackArrays.cpp
@@ -449,7 +449,7 @@ StackArraysAnalysisWrapper::analyseFunction(mlir::Operation *func) {
     const LatticePoint *lattice = solver.lookupState<LatticePoint>(op);
     // there will be no lattice for an unreachable block
     if (lattice)
-      point.join(*lattice);
+      (void)point.join(*lattice);
   };
   func->walk([&](mlir::func::ReturnOp child) { joinOperationLattice(child); });
   func->walk([&](fir::UnreachableOp child) { joinOperationLattice(child); });


        


More information about the flang-commits mailing list