Add a testcase for PR c++/4926

H.J. Lu hongjiu.lu@intel.com
Wed Apr 1 18:09:00 GMT 2009


Hi,

One testcase in PR c++/4926 was fixed by an unrelated patch before 4.4
was branched. I am checking this into trunk and 4.4 branch.


H.J.
---
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 145422)
+++ ChangeLog	(working copy)
@@ -1,3 +1,8 @@
+2009-04-01  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR c++/4926
+	* g++.dg/template/pr4926-1.C: New.
+
 2009-04-01  Xinliang David Li  <davidxl@google.com>
 
 	* gcc.target/i386/all_one_m128i.c: New test.
Index: g++.dg/template/pr4926-1.C
===================================================================
--- g++.dg/template/pr4926-1.C	(revision 0)
+++ g++.dg/template/pr4926-1.C	(revision 0)
@@ -0,0 +1,18 @@
+// PR c++/4926
+// { dg-do compile }
+
+template <unsigned> struct X { typedef int Type; };
+template <typename T> struct Y { char array[1]; };
+ 
+template<typename T> Y<T> P(T);  // acts as "Y<typeof(T)>"
+ 
+struct F { int operator()() const; };
+ 
+template <typename T>
+typename X<sizeof(P(  T()()  ).array)>::Type  foo();
+ 
+void
+bar () 
+{ 
+  foo<F>();
+}



More information about the Gcc-patches mailing list