@@ -442,6 +442,8 @@ enum : unsigned {
442
442
__metafn_return_type_of,
443
443
};
444
444
445
+ consteval auto __workaround_expand_compiler_builtins (info type) -> info;
446
+
445
447
} // namespace detail
446
448
447
449
namespace __range_of_infos {
@@ -1582,15 +1584,15 @@ consteval auto type_is_nothrow_invocable_r(info type_result, info type,
1582
1584
}
1583
1585
1584
1586
consteval auto type_remove_const (info type) -> info {
1585
- return dealias (substitute (^remove_const_t , {type}));
1587
+ return detail::__workaround_expand_compiler_builtins ( dealias (substitute (^remove_const_t , {type}) ));
1586
1588
}
1587
1589
1588
1590
consteval auto type_remove_volatile (info type) -> info {
1589
- return dealias (substitute (^remove_volatile_t , {type}));
1591
+ return detail::__workaround_expand_compiler_builtins ( dealias (substitute (^remove_volatile_t , {type}) ));
1590
1592
}
1591
1593
1592
1594
consteval auto type_remove_cv (info type) -> info {
1593
- return dealias (substitute (^remove_cv_t , {type}));
1595
+ return detail::__workaround_expand_compiler_builtins ( dealias (substitute (^remove_cv_t , {type}) ));
1594
1596
}
1595
1597
1596
1598
consteval auto type_add_const (info type) -> info {
@@ -1606,47 +1608,47 @@ consteval auto type_add_cv(info type) -> info {
1606
1608
}
1607
1609
1608
1610
consteval auto type_remove_reference (info type) -> info {
1609
- return dealias (substitute (^remove_reference_t , {type}));
1611
+ return detail::__workaround_expand_compiler_builtins ( dealias (substitute (^remove_reference_t , {type}) ));
1610
1612
}
1611
1613
1612
1614
consteval auto type_add_lvalue_reference (info type) -> info {
1613
- return dealias (substitute (^add_lvalue_reference_t , {type}));
1615
+ return detail::__workaround_expand_compiler_builtins ( dealias (substitute (^add_lvalue_reference_t , {type}) ));
1614
1616
}
1615
1617
1616
1618
consteval auto type_add_rvalue_reference (info type) -> info {
1617
- return dealias (substitute (^add_rvalue_reference_t , {type}));
1619
+ return detail::__workaround_expand_compiler_builtins ( dealias (substitute (^add_rvalue_reference_t , {type}) ));
1618
1620
}
1619
1621
1620
1622
consteval auto type_make_signed (info type) -> info {
1621
- return dealias (substitute (^make_signed_t , {type}));
1623
+ return detail::__workaround_expand_compiler_builtins ( dealias (substitute (^make_signed_t , {type}) ));
1622
1624
}
1623
1625
1624
1626
consteval auto type_make_unsigned (info type) -> info {
1625
- return dealias (substitute (^make_unsigned_t , {type}));
1627
+ return detail::__workaround_expand_compiler_builtins ( dealias (substitute (^make_unsigned_t , {type}) ));
1626
1628
}
1627
1629
1628
1630
consteval auto type_remove_extent (info type) -> info {
1629
- return dealias (substitute (^remove_extent_t , {type}));
1631
+ return detail::__workaround_expand_compiler_builtins ( dealias (substitute (^remove_extent_t , {type}) ));
1630
1632
}
1631
1633
1632
1634
consteval auto type_remove_all_extents (info type) -> info {
1633
- return dealias (substitute (^remove_all_extents_t , {type}));
1635
+ return detail::__workaround_expand_compiler_builtins ( dealias (substitute (^remove_all_extents_t , {type}) ));
1634
1636
}
1635
1637
1636
1638
consteval auto type_remove_pointer (info type) -> info {
1637
- return dealias (substitute (^remove_pointer_t , {type}));
1639
+ return detail::__workaround_expand_compiler_builtins ( dealias (substitute (^remove_pointer_t , {type}) ));
1638
1640
}
1639
1641
1640
1642
consteval auto type_add_pointer (info type) -> info {
1641
- return dealias (substitute (^add_pointer_t , {type}));
1643
+ return detail::__workaround_expand_compiler_builtins ( dealias (substitute (^add_pointer_t , {type}) ));
1642
1644
}
1643
1645
1644
1646
consteval auto type_remove_cvref (info type) -> info {
1645
- return dealias (substitute (^remove_cvref_t , {type}));
1647
+ return detail::__workaround_expand_compiler_builtins ( dealias (substitute (^remove_cvref_t , {type}) ));
1646
1648
}
1647
1649
1648
1650
consteval auto type_decay (info type) -> info {
1649
- return dealias (substitute (^decay_t , {type}));
1651
+ return detail::__workaround_expand_compiler_builtins ( dealias (substitute (^decay_t , {type}) ));
1650
1652
}
1651
1653
1652
1654
template <reflection_range R = initializer_list<info>>
@@ -1660,7 +1662,7 @@ consteval auto type_common_reference(R &&type_args) -> info {
1660
1662
}
1661
1663
1662
1664
consteval auto type_underlying_type (info type) -> info {
1663
- return dealias (substitute (^underlying_type_t , {type}));
1665
+ return detail::__workaround_expand_compiler_builtins ( dealias (substitute (^underlying_type_t , {type}) ));
1664
1666
}
1665
1667
1666
1668
template <reflection_range R = initializer_list<info>>
@@ -1743,6 +1745,13 @@ consteval auto accessible_subobjects_of(
1743
1745
return subobjects;
1744
1746
}
1745
1747
1748
+ namespace detail {
1749
+ template <class T > struct __wrap_workaround { using type = T; };
1750
+ consteval auto __workaround_expand_compiler_builtins (info type) -> info {
1751
+ return dealias (members_of (substitute (^__wrap_workaround, {type}))[0 ]);
1752
+ }
1753
+
1754
+ } // namespace detail
1746
1755
1747
1756
#if __has_feature(parameter_reflection)
1748
1757
0 commit comments