Skip to content
Snippets Groups Projects
Commit 5c505cba authored by Jason Merrill's avatar Jason Merrill Committed by Jason Merrill
Browse files

re PR c++/40405 (ICE with invalid initialization of template member)

	PR c++/40405
	* pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
	if we got the wrong number of template parms.

From-SVN: r196231
parent 82a1326b
No related branches found
No related tags found
No related merge requests found
2013-02-22 Jason Merrill <jason@redhat.com> 2013-02-22 Jason Merrill <jason@redhat.com>
PR c++/40405
* pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
if we got the wrong number of template parms.
PR c++/56377 PR c++/56377
* pt.c (fn_type_unification): Use explicit args in template * pt.c (fn_type_unification): Use explicit args in template
instantiation context. instantiation context.
......
...@@ -4782,6 +4782,8 @@ push_template_decl_real (tree decl, bool is_friend) ...@@ -4782,6 +4782,8 @@ push_template_decl_real (tree decl, bool is_friend)
error ("got %d template parameters for %q#T", error ("got %d template parameters for %q#T",
TREE_VEC_LENGTH (a), current); TREE_VEC_LENGTH (a), current);
error (" but %d required", TREE_VEC_LENGTH (t)); error (" but %d required", TREE_VEC_LENGTH (t));
/* Avoid crash in import_export_decl. */
DECL_INTERFACE_KNOWN (decl) = 1;
return error_mark_node; return error_mark_node;
} }
   
......
// PR c++/40405
template<int, int> struct A
{
static int i;
};
template<int> int A<0,0>::i = 0; // { dg-error "" }
int j = A<0,0>::i;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment