https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125151
--- Comment #5 from Császár Mátyás <csaszar.mat at gmail dot com> ---
(In reply to Jakub Jelinek from comment #3 and comment #4)
I think A and B is not entirely correct as on the libstdc++ side
cow-stdexcept.cc has explicit default and non-default definitions for:
B::B (const B &) {
... // Real definition
}
B &B::operator= (const B &) {
... // Real definition
}
B::B (B &&) = default; // Explicit default definition
B &B::operator= (B &&) = default; // Explicit default definition
(In reply to Jakub Jelinek from comment #3)
> Do you say the defaulted copy ctor is not linkonce on mingw?
I think the default copy ctor is linkonce and mingw handles that correctly,
this issue comes from the cow-stdexcept.cc definitions.
(In reply to Jakub Jelinek from comment #3)
> Or is the problem just that it is linkonce in all the defaulted definitions
> (so you could link with -O0 -std=c++26 above source and one with
> s/main/foo/) and just that the definition in src/c++98/stdexcept.cc is not
> linkonce and the linker diagnoses such case ?
This is my understanding.
(In reply to Jakub Jelinek from comment #3)
> Note, compiler warns and ignores on [[gnu::weak]] on inline functions (which
> includes the defaulted constexpr methods). Would [[gnu::weak]] on the
> stdexcept.cc symbol fix that?
I dont know enough about this topic to tell. Maybe?
In your previous commit
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=f8c32184b85ce71c154fa96cd5ca700aab902656
the [[__gnu__::__gnu_inline__]] attribute is used.
So I did test that attribute in the header declarations and it seamed to work.