diff --git a/libcxx/include/experimental/meta b/libcxx/include/experimental/meta index 17b8f2158d9461..8b6e58f470c6a2 100644 --- a/libcxx/include/experimental/meta +++ b/libcxx/include/experimental/meta @@ -442,6 +442,8 @@ enum : unsigned { __metafn_return_type_of, }; +consteval auto __workaround_expand_compiler_builtins(info type) -> info; + } // namespace detail namespace __range_of_infos { @@ -1582,15 +1584,15 @@ consteval auto type_is_nothrow_invocable_r(info type_result, info type, } consteval auto type_remove_const(info type) -> info { - return dealias(substitute(^remove_const_t, {type})); + return detail::__workaround_expand_compiler_builtins(dealias(substitute(^remove_const_t, {type}))); } consteval auto type_remove_volatile(info type) -> info { - return dealias(substitute(^remove_volatile_t, {type})); + return detail::__workaround_expand_compiler_builtins(dealias(substitute(^remove_volatile_t, {type}))); } consteval auto type_remove_cv(info type) -> info { - return dealias(substitute(^remove_cv_t, {type})); + return detail::__workaround_expand_compiler_builtins(dealias(substitute(^remove_cv_t, {type}))); } consteval auto type_add_const(info type) -> info { @@ -1606,47 +1608,47 @@ consteval auto type_add_cv(info type) -> info { } consteval auto type_remove_reference(info type) -> info { - return dealias(substitute(^remove_reference_t, {type})); + return detail::__workaround_expand_compiler_builtins(dealias(substitute(^remove_reference_t, {type}))); } consteval auto type_add_lvalue_reference(info type) -> info { - return dealias(substitute(^add_lvalue_reference_t, {type})); + return detail::__workaround_expand_compiler_builtins(dealias(substitute(^add_lvalue_reference_t, {type}))); } consteval auto type_add_rvalue_reference(info type) -> info { - return dealias(substitute(^add_rvalue_reference_t, {type})); + return detail::__workaround_expand_compiler_builtins(dealias(substitute(^add_rvalue_reference_t, {type}))); } consteval auto type_make_signed(info type) -> info { - return dealias(substitute(^make_signed_t, {type})); + return detail::__workaround_expand_compiler_builtins(dealias(substitute(^make_signed_t, {type}))); } consteval auto type_make_unsigned(info type) -> info { - return dealias(substitute(^make_unsigned_t, {type})); + return detail::__workaround_expand_compiler_builtins(dealias(substitute(^make_unsigned_t, {type}))); } consteval auto type_remove_extent(info type) -> info { - return dealias(substitute(^remove_extent_t, {type})); + return detail::__workaround_expand_compiler_builtins(dealias(substitute(^remove_extent_t, {type}))); } consteval auto type_remove_all_extents(info type) -> info { - return dealias(substitute(^remove_all_extents_t, {type})); + return detail::__workaround_expand_compiler_builtins(dealias(substitute(^remove_all_extents_t, {type}))); } consteval auto type_remove_pointer(info type) -> info { - return dealias(substitute(^remove_pointer_t, {type})); + return detail::__workaround_expand_compiler_builtins(dealias(substitute(^remove_pointer_t, {type}))); } consteval auto type_add_pointer(info type) -> info { - return dealias(substitute(^add_pointer_t, {type})); + return detail::__workaround_expand_compiler_builtins(dealias(substitute(^add_pointer_t, {type}))); } consteval auto type_remove_cvref(info type) -> info { - return dealias(substitute(^remove_cvref_t, {type})); + return detail::__workaround_expand_compiler_builtins(dealias(substitute(^remove_cvref_t, {type}))); } consteval auto type_decay(info type) -> info { - return dealias(substitute(^decay_t, {type})); + return detail::__workaround_expand_compiler_builtins(dealias(substitute(^decay_t, {type}))); } template > @@ -1660,7 +1662,7 @@ consteval auto type_common_reference(R &&type_args) -> info { } consteval auto type_underlying_type(info type) -> info { - return dealias(substitute(^underlying_type_t, {type})); + return detail::__workaround_expand_compiler_builtins(dealias(substitute(^underlying_type_t, {type}))); } template > @@ -1743,6 +1745,13 @@ consteval auto accessible_subobjects_of( return subobjects; } +namespace detail { +template struct __wrap_workaround { using type = T; }; +consteval auto __workaround_expand_compiler_builtins(info type) -> info { + return dealias(members_of(substitute(^__wrap_workaround, {type}))[0]); +} + +} // namespace detail #if __has_feature(parameter_reflection)