[flang] [llvm] [llvm][flang] Silence warning, resume -Werror builds of flang (PR #175053)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 8 11:25:28 PST 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-adt
Author: Peter Klausler (klausler)
<details>
<summary>Changes</summary>
Add (void) uses of two parameters to dodge a C++ compiler warning that has broken -Werror builds of flang since 9-28-25, and restore that option as the default for flang builds.
---
Full diff: https://github.com/llvm/llvm-project/pull/175053.diff
2 Files Affected:
- (modified) flang/CMakeLists.txt (+1-1)
- (modified) llvm/include/llvm/ADT/SmallVector.h (+2)
``````````diff
diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt
index c01eb56d5e496..390cfe749f962 100644
--- a/flang/CMakeLists.txt
+++ b/flang/CMakeLists.txt
@@ -37,7 +37,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE)
`CMakeFiles'. Please delete them.")
endif()
-option(FLANG_ENABLE_WERROR "Fail and stop building flang if a warning is triggered." OFF)
+option(FLANG_ENABLE_WERROR "Fail and stop building flang if a warning is triggered." ON)
# Check for a standalone build and configure as appropriate from
# there.
diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
index 51109d1f416f2..23d40c3e07675 100644
--- a/llvm/include/llvm/ADT/SmallVector.h
+++ b/llvm/include/llvm/ADT/SmallVector.h
@@ -211,6 +211,8 @@ class SmallVectorTemplateCommon
this->assertSafeToReferenceAfterResize(From, 0);
this->assertSafeToReferenceAfterResize(To - 1, 0);
}
+ (void)From;
+ (void)To;
}
/// Check whether any part of the range will be invalidated by growing.
``````````
</details>
https://github.com/llvm/llvm-project/pull/175053
More information about the llvm-commits
mailing list