re PR c++/37037 (ICE on template class member function definition after explicit template class instantation)

PR c++/37037
	* decl.c (grokdeclarator): Don't generate a void PARM_DECL.

From-SVN: r154131
This commit is contained in:
Jason Merrill 2009-11-12 17:49:59 -05:00 committed by Jason Merrill
parent d6c057abd6
commit 7b3ad9f900
4 changed files with 20 additions and 1 deletions

View 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.

View 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));

View 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.

View File

@ -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)
{}