Skip to content

Commit 8e1959b

Browse files
committed
Revert "[libc++] Avoid having to export __builtin_common_type from common_type.h"
This reverts commit ca58c03.
1 parent c0a6a5d commit 8e1959b

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

libcxx/include/__type_traits/common_type.h

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <__type_traits/type_identity.h>
1818
#include <__type_traits/void_t.h>
1919
#include <__utility/declval.h>
20+
#include <__utility/empty.h>
2021

2122
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
2223
# pragma GCC system_header
@@ -32,24 +33,8 @@ struct common_type;
3233
template <class... _Args>
3334
using __common_type_t = typename common_type<_Args...>::type;
3435

35-
struct __no_common_type {
36-
using type = __no_common_type;
37-
};
38-
39-
template <class _Common>
40-
struct __common_type_impl {
41-
using type = _Common;
42-
};
43-
44-
template <>
45-
struct __common_type_impl<__no_common_type> {};
46-
47-
// We can't just inherit from __builtin_common_type, because that would require exporting __builtin_common_type
48-
// from this module and there's no way to do that.
4936
template <class... _Args>
50-
struct common_type
51-
: __common_type_impl<
52-
typename __builtin_common_type<__common_type_t, __type_identity, __no_common_type, _Args...>::type> {};
37+
struct common_type : __builtin_common_type<__common_type_t, __type_identity, __empty, _Args...> {};
5338

5439
#else
5540
# if _LIBCPP_STD_VER >= 20

0 commit comments

Comments
 (0)