https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82219
--- Comment #2 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- Well, then gcc could warn for the ignored const of the function return type as well. I don't think this warning makes much sense for templates.