[libcxx-commits] [clang] [libcxx] [Clang] Add __builtin_common_type (PR #99473)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Sep 30 08:34:54 PDT 2024
================
@@ -14,16 +14,30 @@
#include <__type_traits/decay.h>
#include <__type_traits/is_same.h>
#include <__type_traits/remove_cvref.h>
+#include <__type_traits/type_identity.h>
#include <__type_traits/void_t.h>
#include <__utility/declval.h>
+#include <__utility/empty.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 20
+#if __has_builtin(__builtin_common_type)
+
+template <class... _Args>
+struct common_type;
+
+template <class... _Args>
+using __common_type_t = typename common_type<_Args...>::type;
+
+template <class... _Args>
+struct common_type : __builtin_common_type<__common_type_t, __type_identity, __empty, _Args...> {};
----------------
ldionne wrote:
(I am trying to fix this in the following PR where I re-land the modulemap changes: https://github.com/llvm/llvm-project/pull/110501)
https://github.com/llvm/llvm-project/pull/99473
More information about the libcxx-commits
mailing list