the template parameters of the outer template are shadowed; this is not allowed.
This won't shadow the template parameters, template < typename RS > friendstruct ratio_sequence_multiply<RS,0>;
But then, the template declaration would be treated as a specialisation; and specilisations must be placed at namespace scope.