[flang-commits] [flang] 06be148 - [flang][nfc] Fix GCC 11 build

Andrzej Warzynski via flang-commits flang-commits at lists.llvm.org
Thu Mar 3 09:07:13 PST 2022


Author: Andrzej Warzynski
Date: 2022-03-03T17:06:54Z
New Revision: 06be148843618980588a4d63bf37bbd2103d5b77

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

LOG: [flang][nfc] Fix GCC 11 build

After merging https://reviews.llvm.org/D120801, Flang no longer builds
with GCC 11:
```
../llvm-project/flang/lib/Semantics/runtime-type-info.cpp:385:22: error: variable ‘lenParam’ set but not used [-Werror=unused-but-set-variable]
  385 |       for (SymbolRef lenParam : *lenParameters) {
      |                      ^~~~~~~~
```

I'm sending this without a review as a quick fix.

Added: 
    

Modified: 
    flang/lib/Semantics/runtime-type-info.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Semantics/runtime-type-info.cpp b/flang/lib/Semantics/runtime-type-info.cpp
index 12dbd78b23c16..a744efc36b283 100644
--- a/flang/lib/Semantics/runtime-type-info.cpp
+++ b/flang/lib/Semantics/runtime-type-info.cpp
@@ -383,6 +383,7 @@ const Symbol *RuntimeTableBuilder::DescribeType(Scope &dtScope) {
       // Create dummy deferred values for the length parameters so that the
       // DerivedTypeSpec is complete and can be used in helpers.
       for (SymbolRef lenParam : *lenParameters) {
+        (void)lenParam;
         derived.AddRawParamValue(
             std::nullopt, ParamValue::Deferred(common::TypeParamAttr::Len));
       }


        


More information about the flang-commits mailing list