re PR c++/14106 ([testcase] ICE on template func instanciation: stor-layout.c:1569)
authorKriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
Mon, 23 Feb 2004 14:12:56 +0000 (14:12 +0000)
committerKriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org>
Mon, 23 Feb 2004 14:12:56 +0000 (14:12 +0000)
PR c++/14106
* g++.dg/ext/typeof9.C: New test.

From-SVN: r78304

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/typeof9.C [new file with mode: 0644]

index 40ea07f019071ff6526811fe422ea7172e38489f..9eaab98f3cc754e703741d6fb6656999bdbeb2df 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-23  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
+
+       PR c++/14106
+       * g++.dg/ext/typeof9.C: New test.
+
 2004-02-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
 
        PR c++/14250
diff --git a/gcc/testsuite/g++.dg/ext/typeof9.C b/gcc/testsuite/g++.dg/ext/typeof9.C
new file mode 100644 (file)
index 0000000..1547c0f
--- /dev/null
@@ -0,0 +1,17 @@
+// { dg-do compile }
+
+// Origin: gcc-bug@vogtner.de
+
+// PR c++/14106: ICE with typeof of function template.
+
+template<class T>
+void j (T i)
+{
+}
+
+template<typename T>
+void instanciate () {
+   static void (*fp) (T) = j;
+   __typeof__ (j) *p;  // { dg-error "unknown|invalid" }
+}
+template void instanciate<float>();