[libcxx-commits] [libcxx] 83d97a5 - [libc++] Move _LIBCPP_CONCAT{, 3} to <__configuration/utility.h> (#205533)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 24 05:48:22 PDT 2026


Author: Nikolas Klauser
Date: 2026-06-24T14:48:16+02:00
New Revision: 83d97a53509b74a612148d7d366f8c3359237883

URL: https://github.com/llvm/llvm-project/commit/83d97a53509b74a612148d7d366f8c3359237883
DIFF: https://github.com/llvm/llvm-project/commit/83d97a53509b74a612148d7d366f8c3359237883.diff

LOG: [libc++] Move _LIBCPP_CONCAT{,3} to <__configuration/utility.h> (#205533)

The macro is already used in `<__configuration/attributes.h>` and just
happens to work because we include both headers.
`<__configuration/utility.h>` seems like the obvious place to put the
macros.

Added: 
    

Modified: 
    libcxx/include/__config
    libcxx/include/__configuration/utility.h

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__config b/libcxx/include/__config
index 714cd0fd26b36..802440bae5ef6 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -28,6 +28,7 @@
 #  include <__configuration/language.h>
 #  include <__configuration/namespace.h>
 #  include <__configuration/platform.h>
+#  include <__configuration/utility.h>
 
 // The attributes supported by clang are documented at https://clang.llvm.org/docs/AttributeReference.html
 
@@ -36,10 +37,6 @@
 // defined to XXYYZZ.
 #  define _LIBCPP_VERSION 230000
 
-#  define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y
-#  define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y)
-#  define _LIBCPP_CONCAT3(X, Y, Z) _LIBCPP_CONCAT(X, _LIBCPP_CONCAT(Y, Z))
-
 #  ifndef __has_constexpr_builtin
 #    define __has_constexpr_builtin(x) 0
 #  endif

diff  --git a/libcxx/include/__configuration/utility.h b/libcxx/include/__configuration/utility.h
index 81e91887614d3..2f06af151dd05 100644
--- a/libcxx/include/__configuration/utility.h
+++ b/libcxx/include/__configuration/utility.h
@@ -19,4 +19,8 @@
 #define _LIBCPP_TOSTRING2(x) #x
 #define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x)
 
+#define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y
+#define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y)
+#define _LIBCPP_CONCAT3(X, Y, Z) _LIBCPP_CONCAT(X, _LIBCPP_CONCAT(Y, Z))
+
 #endif // _LIBCPP___CONFIGURATION_UTILITY_H


        


More information about the libcxx-commits mailing list