[llvm] llvm/unittests: Suppress warnings to mark them `[[maybe_unused]]` [-Wunused-template] (PR #215565)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 11 06:43:54 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-ir
Author: NAKAMURA Takumi (chapuni)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/215565.diff
3 Files Affected:
- (modified) llvm/unittests/ADT/SmallVectorTest.cpp (+1)
- (modified) llvm/unittests/IR/IntrinsicsTest.cpp (+1-1)
- (modified) llvm/unittests/Support/RecyclerTest.cpp (+1-1)
``````````diff
diff --git a/llvm/unittests/ADT/SmallVectorTest.cpp b/llvm/unittests/ADT/SmallVectorTest.cpp
index ebecacefcb0c5..a678416892ee2 100644
--- a/llvm/unittests/ADT/SmallVectorTest.cpp
+++ b/llvm/unittests/ADT/SmallVectorTest.cpp
@@ -1064,6 +1064,7 @@ struct Emplaceable {
State(ES_Emplaced) {}
template <class A0Ty, class A1Ty, class A2Ty>
+ [[maybe_unused]]
Emplaceable(A0Ty &&A0, A1Ty &&A1, A2Ty &&A2)
: A0(std::forward<A0Ty>(A0)), A1(std::forward<A1Ty>(A1)),
A2(std::forward<A2Ty>(A2)), State(ES_Emplaced) {}
diff --git a/llvm/unittests/IR/IntrinsicsTest.cpp b/llvm/unittests/IR/IntrinsicsTest.cpp
index d502bf591b7fa..f1d22014e24c4 100644
--- a/llvm/unittests/IR/IntrinsicsTest.cpp
+++ b/llvm/unittests/IR/IntrinsicsTest.cpp
@@ -57,7 +57,7 @@ class IntrinsicsTest : public ::testing::Test {
}
return Builder.CreateCall(Decl, ProcessedArgs);
}
- template <typename T> void checkIsa(const Instruction &I) {
+ template <typename T> [[maybe_unused]] void checkIsa(const Instruction &I) {
EXPECT_TRUE(isa<T>(I));
}
};
diff --git a/llvm/unittests/Support/RecyclerTest.cpp b/llvm/unittests/Support/RecyclerTest.cpp
index 696e397d3f10e..b4494a0e6ef5e 100644
--- a/llvm/unittests/Support/RecyclerTest.cpp
+++ b/llvm/unittests/Support/RecyclerTest.cpp
@@ -31,7 +31,7 @@ class DecoratedMallocAllocator : public MallocAllocator {
MallocAllocator::Deallocate(Ptr, Size, Alignment);
}
- template <typename T> void Deallocate(T *Ptr) {
+ template <typename T> [[maybe_unused]] void Deallocate(T *Ptr) {
DeallocCount++;
MallocAllocator::Deallocate(Ptr);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/215565
More information about the llvm-commits
mailing list