https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114777
Bug ID: 114777 Summary: inconsistent warning for pure functions on deconstructors/constructors on arm compared to other targets Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- Target: arm-eabi, arm-linux-gnueabi Take: ``` struct A { A(); [[gnu::pure]] ~A(); }; ``` This warns on all targets except for arm-eabi (and arm-linux-gnueabi) due to having targetm.cxx.cdtor_returns_this() return true. I only noticed this while working on PR 19661 .