http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49418
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-06-21 13:34:35 UTC --- Perhaps the top-level quals from the older type could be used, if the standard doesn't disallow it? Like, if T const arg is instantiated with T int or const int, it would be int const arg, while if it is T arg instantiated with int or const int, it would be int arg.