https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109945
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Note to make it fail at -O2 and above is simple just add [[gnu::noipa]] to make definition like this: [[gnu::noipa]] Widget make() { return Widget(); }