https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114968
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #58123|0 |1 is obsolete| | --- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 58125 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58125&action=edit gcc15-pr114968.patch Here is an updated patch. Note, even when not taking thiscall attribute into consideration, the existing code was wrong on the !targetm.cxx.use_atexit_for_cxa_atexit () targets (aka mingw), because it would happily use the atexit function argument type (aka void (*) ()) for __cxa_thread_atexit.