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

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to cqwrteur from comment #4)
> btw since the function is inline linkaged, the entire program would only
> contain one copy of __my_glibcxx_constexpr_assert<T>. For example for
> std::span::operator[] the entire program shares the bounds checking part.

Isn't that already true today? span::operator[] is inline too, so there's only
one copy of that, and no copies of __my_glibcxx_constexpr_assert<T> at all.

You're adding lots of new symbols to the object files, which must be merged by
the linker. The difference is that setting up the arguments to
__glibcxx_assert_fail is in the new function, not in span::operator[].

Reply via email to