This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Add a testcase for PR c++/4926
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 1 Apr 2009 11:09:03 -0700
- Subject: Add a testcase for PR c++/4926
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
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>();
+}