]> 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 22:49:59 +0000 (17:49 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 12 Nov 2009 22:49:59 +0000 (17:49 -0500)
PR c++/37037
* decl.c (grokdeclarator): Don't generate a void PARM_DECL.

From-SVN: r154131

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

index e0b5f2771da5b7b8f81ea3be3cf93d0a2b2ab7a8..333c84d88b5867a4ef3e032da891033402a75023 100644 (file)
@@ -1,5 +1,8 @@
 2009-11-12  Jason Merrill  <jason@redhat.com>
 
+       PR c++/37037
+       * decl.c (grokdeclarator): Don't generate a void PARM_DECL.
+
        PR c++/42013
        * call.c (build_conditional_expr): Check specifically for folding
        to CALL_EXPR rather than TREE_SIDE_EFFECTS.
index 5e2f85fd9d4d911edb610a995934db8b8b2775f6..e23634f3f6ef8237c22e971faa49caabb7861964 100644 (file)
@@ -8993,7 +8993,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 d5115fd09ac89f61b3d89ac3456c9fc853689eef..49f2e6ab2d1006f1d6d1d108fb8792443cea0e40 100644 (file)
@@ -1,5 +1,8 @@
 2009-11-12  Jason Merrill  <jason@redhat.com>
 
+       PR c++/37037
+       * g++.dg/template/typedef21.C: New.
+
        PR c++/42013
        * g++.dg/cpp0x/decltype19.C: New.
 
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)
+{}
+