[Bug c++/16829] default parameter can be not one of the last in template function

charles at kde dot org gcc-bugzilla@gcc.gnu.org
Fri Jul 30 04:04:00 GMT 2004


------- Additional Comments From charles at kde dot org  2004-07-30 04:04 -------
And now I have the ICE (which may be rather unrelated): 
 
template <class A> void foo(A a, int c=0, int d) 
{ } 
 
int main() 
{ 
	foo(0); 
} 
 
To reproduce this, create a template function in which a parameter has a 
default value, but it has a parameter after it without a default value.  Then 
try to call that template function where the number of parameters passed is 
the number of parameters that have no default, up to the one that does have a 
default. (whew!) 
 
reproduced on: 
 gcc version 3.3.3 20040412 (Gentoo Linux 3.3.3-r6, ssp-3.3.2-2, pie-8.7.6) 
 

-- 


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



More information about the Gcc-bugs mailing list