[libcxx-commits] [libcxx] 53c6ce1 - [libc++][cmp][NFC] Fix: Empty namespaces should be avoided (#210624)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jul 19 19:48:03 PDT 2026


Author: Hristo Hristov
Date: 2026-07-20T05:47:58+03:00
New Revision: 53c6ce165aef58e1885d574c1ec597d091c3c8fc

URL: https://github.com/llvm/llvm-project/commit/53c6ce165aef58e1885d574c1ec597d091c3c8fc
DIFF: https://github.com/llvm/llvm-project/commit/53c6ce165aef58e1885d574c1ec597d091c3c8fc.diff

LOG: [libc++][cmp][NFC] Fix: Empty namespaces should be avoided (#210624)

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]

Added: 
    

Modified: 
    libcxx/include/__utility/cmp.h

Removed: 
    


################################################################################
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


        


More information about the libcxx-commits mailing list