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

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Hana Dusíková from comment #12)
> I'm using [[gnu::used]] to emit constexpr symbol so it can be part of
> compatible interface.

I think we don't have a problem with exporting the ABI compatible symbols,
those are compiled with -std=c++98 mostly.  The question is whether we want to
pay the price of defining comdat vtables for all the exception subclasses in
C++26.
I think #pragma interface could work if the exception subclasses are defined in
separate headers, but unsure if it can work well for std::exception itself when
it has also
    _GLIBCXX26_CONSTEXPR exception(const exception&) = default;
    _GLIBCXX26_CONSTEXPR exception& operator=(const exception&) = default;
    _GLIBCXX26_CONSTEXPR exception(exception&&) = default;
    _GLIBCXX26_CONSTEXPR exception& operator=(exception&&) = default;
While one can't take address of the ctor (and perhaps it could be
[[__gnu__::__always_inline__]] too just in case), I think for the assignment
operator one could take pointer to member and let it be emitted out of line,
but with #pragma interface that would require definition somewhere else (which
is not the case).

OT, I've tried your branch on godbolt and I see exceptions propagating there
through noexcept function boundaries - the baz (1) case in constexpr-eh2.C in
the above patch.

Reply via email to