[Committed] Add testcase for PR C++/17570: Extension to incorporate default parameters in signature of templates breaks valid program

Andrew Pinski pinskia@gmail.com
Thu Apr 16 17:15:00 GMT 2009


Hi,
  We removed this extension awhile back but this bug report was never
closed and the testcase was never added.  This patch adds the
testcase.

Committed as obvious.

Thanks,
Andrew Pinski

ChangeLog:

* g++.dg/template/defarg11.C: New test.
-------------- next part --------------
Index: g++.dg/template/defarg11.C
===================================================================
--- g++.dg/template/defarg11.C	(revision 0)
+++ g++.dg/template/defarg11.C	(revision 0)
@@ -0,0 +1,18 @@
+// { dg-do compile }
+
+// We used to reject this code as the extension
+// for default arguments being accepted as less the
+// needed template arguments.
+
+
+template<typename> struct match { }; 
+ 
+template<template<typename> class t,typename T>  
+struct match<t<T> > { typedef int type; }; 
+ 
+template<template<typename,typename> class t,typename T0,typename T1> 
+struct match<t<T0,T1> > { typedef int type; }; 
+ 
+template<typename,typename =void> struct other { }; 
+ 
+typedef match<other<void,void> >::type type; 


More information about the Gcc-patches mailing list