use param's index rather than its decl when check if it is used.

the NamedDecl in the UsedParameters set is not be
the same one when we have multiple template declarations