[flang] [llvm] [CI] Enable -Werror in pre-merge CI (PR #155627)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 28 06:08:24 PDT 2025
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/155627
>From 31dd130a87b132363ed96a6712fd14f818fbdc85 Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov at redhat.com>
Date: Wed, 27 Aug 2025 16:13:59 +0200
Subject: [PATCH 1/2] Enable -Werror in pre-merge CI
We have many buildbots that run with -Werror, but it's currently
not enabled in pre-merge CI, so adding a warning causes a slew
of post-commit failures.
Note that we only guarantee warning freedom when compiling with a
recent version of clang, but not when using gcc or msvc. The
monolithic-linux build uses recent clang, so it should be safe
to enable the option there.
---
.ci/monolithic-linux.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh
index 3ca4d05f4c891..5abb8d72df028 100755
--- a/.ci/monolithic-linux.sh
+++ b/.ci/monolithic-linux.sh
@@ -61,7 +61,8 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
-D LLDB_ENABLE_PYTHON=ON \
-D LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=ON \
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
- -D CMAKE_EXE_LINKER_FLAGS="-no-pie"
+ -D CMAKE_EXE_LINKER_FLAGS="-no-pie" \
+ -D LLVM_ENABLE_WERROR=ON
start-group "ninja"
>From 728002b252c274af00d60f0a44b92eef4e971e0b Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov at redhat.com>
Date: Thu, 28 Aug 2025 15:07:34 +0200
Subject: [PATCH 2/2] [flang] Fix -Wcharacter-conversion warnings (NFC)
---
flang/lib/Evaluate/fold-implementation.h | 2 +-
flang/lib/Parser/characters.cpp | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/flang/lib/Evaluate/fold-implementation.h b/flang/lib/Evaluate/fold-implementation.h
index d757ef6e62eb4..3fdf3a6f38848 100644
--- a/flang/lib/Evaluate/fold-implementation.h
+++ b/flang/lib/Evaluate/fold-implementation.h
@@ -1785,7 +1785,7 @@ common::IfNoLvalue<std::optional<TO>, FROM> ConvertString(FROM &&s) {
if (static_cast<std::uint64_t>(*iter) > 127) {
return std::nullopt;
}
- str.push_back(*iter);
+ str.push_back(static_cast<typename TO::value_type>(*iter));
}
return std::make_optional<TO>(std::move(str));
}
diff --git a/flang/lib/Parser/characters.cpp b/flang/lib/Parser/characters.cpp
index f6ac777ea874c..1a00b16eefe9d 100644
--- a/flang/lib/Parser/characters.cpp
+++ b/flang/lib/Parser/characters.cpp
@@ -289,7 +289,8 @@ RESULT DecodeString(const std::string &s, bool backslashEscapes) {
DecodeCharacter<ENCODING>(p, bytes, backslashEscapes)};
if (decoded.bytes > 0) {
if (static_cast<std::size_t>(decoded.bytes) <= bytes) {
- result.append(1, decoded.codepoint);
+ result.append(
+ 1, static_cast<typename RESULT::value_type>(decoded.codepoint));
bytes -= decoded.bytes;
p += decoded.bytes;
continue;
More information about the llvm-commits
mailing list