Partial ordering bug (?) in egcs

Todd Veldhuizen tveldhui@seurat.uwaterloo.ca
Mon Aug 10 13:20:00 GMT 1998


In the following example, egcs complains that the call max(A,j) is
ambiguous.  The EDG front end accepts this code, as does aCC.  One of 
you has to be wrong, although after studying the relevant section of the
FDIS I'm not sure who.  If you think this behavior of egcs is
correct, I'll submit bug reports against EDG and aCC.  I have
a simple workaround in the meantime (making parameter 2 of #2 const&).

Thanks,
Todd

template<int N>
class IndexPlaceholder {
};

template<class T, int N>
class Array {
};

// #1
template<class T1, class T2>
void max(const T1& a, const T2& b)
{
}

// #2
template<class T_numtype, int N_rank, int N_index>
inline void
max(const Array<T_numtype, N_rank>& array, IndexPlaceholder<N_index>)
{
}

int main()
{
    Array<int,2> A;
    IndexPlaceholder<2> j;
    max(A,j);                     // should match #2?
}




More information about the Gcc-bugs mailing list