------- Additional Comments From bangerth at dealii dot org  2005-07-25 15:21 
-------
This basically boils down to this question: 
--------------------- 
template <class> struct S { typedef int type; }; 
 
template <class T> 
int foo(T, typename S<T>::type * ret); 
 
int j = foo(1, 0); 
---------------------- 
icc accepts this, gcc doesn't. I believe it should. The question is whether 
the second of the arguments, of type int, should be converted to the  
expected int*. During template deduction, no conversions are performed. I.e. 
if we had declared foo as foo(T,T*), then we should reject the call. However, 
the template type T is used in a non-deductible context in the second argument 
of foo, so the type of T should be deduced only based on the first argument, 
to type int then. 
 
W. 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23055

Reply via email to