------- Comment #7 from igodard at pacbell dot net 2006-10-21 21:16 ------- Please forgive my naive understanding of the standard, but it was my impression that the return type of a function never participated in overload resolution. That is, for any given set of overloads and a call, the return types of the overloads can be changed arbitrarily and in all cases the compiler should produce the same identification (if successful) or same diagnostic (if not).
We have here a case where this rule (if rule it is) is violated. If the overloads are: template<typename T> void foo(int); template<typename C> typename a<C>::value_type foo(const C&); then you get a diagnostic, but if the overloads are: template<typename T> void foo(int); template<typename C> void foo(const C&); then you don't. I leave to wiser heads whether a diagnostic should issue, but whether it should or should not then it should (or should not) in both cases. Ivan -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21413