]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/37037 (ICE on template class member function definition after explicit...
authorJason Merrill <jason@redhat.com>
Thu, 12 Nov 2009 23:22:10 +0000 (18:22 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 12 Nov 2009 23:22:10 +0000 (18:22 -0500)
PR c++/37037
* decl.c (grokdeclarator): Don't generate a void PARM_DECL.

From-SVN: r154135

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/typedef21.C [new file with mode: 0644]

index 283b2399ad7939f9a78d8d94d7615fd818169641..0990ca687e01fe1b122fcebca1de7d765b4d1688 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-12  Jason Merrill  <jason@redhat.com>
+
+       PR c++/37037
+       * decl.c (grokdeclarator): Don't generate a void PARM_DECL.
+
 2009-11-09  Jason Merrill  <jason@redhat.com>
 
        PR c++/41972
index cef56338016c0e5a7171f77894c05ae867985966..c737169837caa7cd5270e20d59285171fb1f3632 100644 (file)
@@ -8635,7 +8635,9 @@ grokdeclarator (const cp_declarator *declarator,
       tree decls = NULL_TREE;
       tree args;
 
-      for (args = TYPE_ARG_TYPES (type); args; args = TREE_CHAIN (args))
+      for (args = TYPE_ARG_TYPES (type);
+          args && args != void_list_node;
+          args = TREE_CHAIN (args))
        {
          tree decl = cp_build_parm_decl (NULL_TREE, TREE_VALUE (args));
 
index cf487e7f93f8d8686a740e59ac25ab22026a1f50..ef66c3ee5f074520441bc1ff7d31cbbd20d78fad 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-12  Jason Merrill  <jason@redhat.com>
+
+       PR c++/37037
+       * g++.dg/template/typedef21.C: New.
+
 2009-11-09  Jason Merrill  <jason@redhat.com>
 
        PR c++/41972
diff --git a/gcc/testsuite/g++.dg/template/typedef21.C b/gcc/testsuite/g++.dg/template/typedef21.C
new file mode 100644 (file)
index 0000000..3185331
--- /dev/null
@@ -0,0 +1,11 @@
+// PR c++/37037
+
+typedef void F(void);
+template <typename T> struct S 
+{
+    static F f;
+};
+template class S<int>;
+template <class T> void S<T>::f(void)
+{}
+