https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84573
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |NEW --- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> --- I believe the warning would be helpful because as I mentioned in comment #0: ...the only valid specialization of such a template is one where T = void it's likely that the missing return statement is a mistake... A function template that returns a template argument should be defined that way even if it's meant to be instantiated on void: template <class T> T g () { return T (); } // valid for any default-constructible type, even void void h () { return g<void>(); } // valid Warning for a missing return statement would be helpful in template libraries that rarely instantiate all their code either during a build or in their tests.