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

--- Comment #1 from Császár Mátyás <csaszar.mat at gmail dot com> ---
The possible cause appears to be that `cow-stdexcept.cc` provides out-of-line
definitions for the copy constructor and copy assignment operators for the
exception types, but these conflict with the `= default` definitions introduced
in the `__cpp_lib_constexpr_exceptions >= 202502L` path in
`stdexcept_except.h`. 

IIUC on ELF targets, this is hidden by weak symbol semantics, but on PE/COFF
(MinGW64) the conflict surfaces as a multiple definition error at link time.

I can see two ways to fix this: adding weak symbol attributes to the relevant
declarations in `stdexcept_except.h` (though I am not sure which would be
appropriate here), or guarding the conflicting definitions in
`cow-stdexcept.cc` under `#if __cpp_lib_constexpr_exceptions < 202502L`.
However, I am not confident enough in the ABI implications of either approach
to say which is correct.

Reply via email to