Skip to content

Commit

Permalink
workaround for unexpanded builtins in experimental/meta
Browse files Browse the repository at this point in the history
  • Loading branch information
dhollman committed Jun 26, 2024
1 parent ebb430e commit feffd44
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion libcxx/include/experimental/meta
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,8 @@ enum : unsigned {
__metafn_return_type_of,
};

consteval auto __workaround_expand_compiler_builtins(info type) -> info;

} // namespace detail

namespace __range_of_infos {
Expand Down Expand Up @@ -1681,7 +1683,7 @@ consteval auto type_add_pointer(info type) -> info {
}

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 {
Expand Down Expand Up @@ -1882,6 +1884,13 @@ consteval auto accessible_subobjects_of(access_pair p) -> vector<info> {
return subobjects;
}

namespace detail {
template <class T> 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)

Expand Down

0 comments on commit feffd44

Please sign in to comment.