[libc-commits] [libc] [libc][test] Remove internal linkage from ErrnoSetterMatcher helpers … (PR #207707)

Aditya Medhane via libc-commits libc-commits at lists.llvm.org
Mon Jul 6 04:10:31 PDT 2026


https://github.com/flash1729 created https://github.com/llvm/llvm-project/pull/207707

`Succeeds`, `Fails`, and `returns` are static function templates in a header, so any test TU that includes it without using all of them trips `-Wunused-template`. Dropping static also matches the neighboring EQ/NE helpers, which are already non-static.

Part of #202945.

>From e0b0829d3244fc8f9e25423fb03b17bd5a4c6383 Mon Sep 17 00:00:00 2001
From: flash1729 <sherlockedaditya at gmail.com>
Date: Mon, 6 Jul 2026 15:39:13 +0530
Subject: [PATCH] [libc][test] Remove internal linkage from ErrnoSetterMatcher
 helpers (NFC)

Succeeds, Fails, and returns are static function templates in a header, so
any test TU that includes it without using all of them trips
-Wunused-template. Dropping static also matches the neighboring EQ/NE
helpers, which are already non-static.

Part of #202945.
---
 libc/test/UnitTest/ErrnoSetterMatcher.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libc/test/UnitTest/ErrnoSetterMatcher.h b/libc/test/UnitTest/ErrnoSetterMatcher.h
index 212b7a8f83e74..e883308314087 100644
--- a/libc/test/UnitTest/ErrnoSetterMatcher.h
+++ b/libc/test/UnitTest/ErrnoSetterMatcher.h
@@ -153,15 +153,15 @@ template <typename T> internal::Comparator<T> NE(T val) {
 }
 
 template <typename RetT = int>
-static internal::ErrnoSetterMatcher<RetT> Succeeds(RetT ExpectedReturn = 0,
-                                                   int ExpectedErrno = 0) {
+internal::ErrnoSetterMatcher<RetT> Succeeds(RetT ExpectedReturn = 0,
+                                            int ExpectedErrno = 0) {
   return internal::ErrnoSetterMatcher<RetT>(EQ(ExpectedReturn),
                                             EQ(ExpectedErrno));
 }
 
 template <typename RetT = int>
-static internal::ErrnoSetterMatcher<RetT> Fails(int ExpectedErrno,
-                                                RetT ExpectedReturn = -1) {
+internal::ErrnoSetterMatcher<RetT> Fails(int ExpectedErrno,
+                                         RetT ExpectedReturn = -1) {
   return internal::ErrnoSetterMatcher<RetT>(EQ(ExpectedReturn),
                                             EQ(ExpectedErrno));
 }
@@ -180,7 +180,7 @@ template <typename RetT = int> class ErrnoSetterMatcherBuilder {
 };
 
 template <typename RetT>
-static ErrnoSetterMatcherBuilder<RetT> returns(internal::Comparator<RetT> cmp) {
+ErrnoSetterMatcherBuilder<RetT> returns(internal::Comparator<RetT> cmp) {
   return ErrnoSetterMatcherBuilder<RetT>(cmp);
 }
 



More information about the libc-commits mailing list