https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109942
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- You can add [[gnu::noinline]] to the function template if you really want to prevent it from being inlined, but it won't prevent it being instantiated.