Correctly propagate the storage class to function template instantiations.

This fixes pr15753. This is another case of the fuzzy definition of the
"as written" storage class of an instantiation.