https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124396

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |mpolacek at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The compiler does in reflect.cc look up right now
std::ranges::contiguous_range, std::ranges::range_value_t,
std::ranges::range_reference_t, std::ranges::data, std::ranges::size,
std::ranges::begin, std::ranges::end, std::array, std::vector, std::tuple_size,
std::variant_size, std::invoke_result, std::tuple_element,
std::variant_alternative, std::common_type, std::common_reference,
std::unwrap_reference, std::unwrap_ref_decay, std::is_invocable_r,
std::is_nothrow_invocable_r, std::is_swappable_with,
std::is_nothrow_swappable_with.
For many of those it just instantiates a template and uses ::type or ::value on
it, for  std::vector it just constructs it from std::initializer_list.
As for std::string/std::u8string, everything it does on it is in the header
directly,
in particular the std::string and std::u8string members of std::meta::exception
are constructed from std::string_view/std::u8string_view,
std::meta::exception::{,u8}what()
calls size() methods on those and for what() c_str() on it too while for
u8what() constructs std::u8string_view from it.

Note, the standard doesn't require std::string/std::u8string to be used and it
is exposition-only, so we could use something completely different that just
allows us to store persistently the strings in the object (and it is all in
<meta> directly).

For std::{,u8}string_view we don't look it up in the compiler, just construct
something with the return type for meta fns returning that, and on the other
side use all the std::ranges::* stuff mentioned above on those when used as
inputs (including the magic
std::meta::exception::_S_exception_cvt_to_utf8 and
std::meta::exception::_S_exception_cvt_from_utf8 templates which use the
std::{,u8}string_view argument as an input range.

<source_location> is I think fairly small and we construct std::source_location
objects.
std::span is also used directly in <meta> and not in reflect.cc directly.

Reply via email to