[libcxx-commits] [libcxx] [libc++][NFC] Fix: Empty namespaces should be avoided (PR #210624)
via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Jul 19 13:10:26 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Hristo Hristov (H-G-Hristov)
<details>
<summary>Changes</summary>
Context: Including `<__utility/cmp.h>` causes:
> cmp.h:25:1: error: Empty namespaces should be avoided. Move any checks around the namespace instead. [libcpp-avoid-empty-namespaces,-warnings-as-errors]
---
Full diff: https://github.com/llvm/llvm-project/pull/210624.diff
1 Files Affected:
- (modified) libcxx/include/__utility/cmp.h (+4-4)
``````````diff
diff --git a/libcxx/include/__utility/cmp.h b/libcxx/include/__utility/cmp.h
index 7cfe640ceb423..360cf2eaa2aa4 100644
--- a/libcxx/include/__utility/cmp.h
+++ b/libcxx/include/__utility/cmp.h
@@ -22,10 +22,10 @@
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
-_LIBCPP_BEGIN_NAMESPACE_STD
-
#if _LIBCPP_STD_VER >= 20
+_LIBCPP_BEGIN_NAMESPACE_STD
+
template <typename _Tp, typename _Ip>
concept __comparison_can_promote_to =
sizeof(_Tp) < sizeof(_Ip) || (sizeof(_Tp) == sizeof(_Ip) && __signed_integer<_Tp>);
@@ -84,10 +84,10 @@ template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>
std::cmp_greater_equal(__u, numeric_limits<_Tp>::min());
}
-#endif // _LIBCPP_STD_VER >= 20
-
_LIBCPP_END_NAMESPACE_STD
+#endif // _LIBCPP_STD_VER >= 20
+
_LIBCPP_POP_MACROS
#endif // _LIBCPP___UTILITY_CMP_H
``````````
</details>
https://github.com/llvm/llvm-project/pull/210624
More information about the libcxx-commits
mailing list