------- Comment #5 from igodard at pacbell dot net 2005-10-31 01:08 ------- Well, the actual argument type is wholely resolved at point of call. And the formal parameter type is valid at the point where sort is defined. It will recognize A<int> as an A<E>, it will recognize A<int>* as an A<E>*, and it should (I think) recognize A<int>::iterator as an A<E>::iterator. It is true that if main() were a template then the call would be subject to being hijacked by a later specialization of A, but main() is a plain function and the rule is that it sees the specializations it sees. And sort(), being a function, cannot be specialized.
That makes it unambiguous to me. You? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24588