[llvm] [CodeGen][test] Fix Buildbot failure due to uninitialized variables (PR #161085)
A. Jiang via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 28 07:46:59 PDT 2025
https://github.com/frederick-vs-ja created https://github.com/llvm/llvm-project/pull/161085
Under some options used by LLVM Buildbot, an uninitialized variable (recently added to the test suite) caused constant evaluation failure, despite the type of that variable is an empty class.
This PR explicitly initializes the variables with `{}` to fix the error. Follows-up #160804.
>From b94290eb9ad2e84db78a1bd2ba7d7499cc8f2e2c Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Sun, 28 Sep 2025 22:46:16 +0800
Subject: [PATCH] [CodeGen][test] Fix Buildbot failure due to uninitialized
variables
Under some options used by LLVM Buildbot, an uninitialized variable (recently added to the test suite) caused constant evaluation failure, despite the type of that variable is an empty class.
This PR explicitly initializes the variables with `{}` to fix the error.
---
llvm/unittests/CodeGen/TypeTraitsTest.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/unittests/CodeGen/TypeTraitsTest.cpp b/llvm/unittests/CodeGen/TypeTraitsTest.cpp
index 1c8852fc1f071..f0ed0e870cbb3 100644
--- a/llvm/unittests/CodeGen/TypeTraitsTest.cpp
+++ b/llvm/unittests/CodeGen/TypeTraitsTest.cpp
@@ -39,7 +39,7 @@ static_assert(std::is_trivially_copyable_v<IdentifyingPassPtr>,
template <class Fn> constexpr bool CheckStdCmpRequirements() {
// std::less and std::equal_to are literal, default constructible, and
// copyable classes.
- Fn f1;
+ Fn f1{};
auto f2 = f1;
auto f3 = std::move(f2);
f2 = f3;
More information about the llvm-commits
mailing list