Commit 6c283621 by Jason Merrill Committed by Jason Merrill

re PR c++/65646 (ICE in invalid syntax)

	PR c++/65646
	* pt.c (check_explicit_specialization): Don't
	SET_DECL_TEMPLATE_SPECIALIZATION for a variable with no template
	headers.
	* decl.c (grokvardecl): Revert earlier fix.

From-SVN: r222376
parent 26677152
2015-04-23 Jason Merrill <jason@redhat.com>
PR c++/65646
* pt.c (check_explicit_specialization): Don't
SET_DECL_TEMPLATE_SPECIALIZATION for a variable with no template
headers.
* decl.c (grokvardecl): Revert earlier fix.
2015-04-20 Paolo Carlini <paolo.carlini@oracle.com> 2015-04-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/65801 PR c++/65801
......
...@@ -8210,9 +8210,7 @@ grokvardecl (tree type, ...@@ -8210,9 +8210,7 @@ grokvardecl (tree type,
DECL_INTERFACE_KNOWN (decl) = 1; DECL_INTERFACE_KNOWN (decl) = 1;
// Handle explicit specializations and instantiations of variable templates. // Handle explicit specializations and instantiations of variable templates.
if (orig_declarator if (orig_declarator)
/* For GCC 5 fix 65646 this way. */
&& current_tmpl_spec_kind (template_count) != tsk_none)
decl = check_explicit_specialization (orig_declarator, decl, decl = check_explicit_specialization (orig_declarator, decl,
template_count, 0); template_count, 0);
......
...@@ -2424,7 +2424,7 @@ check_explicit_specialization (tree declarator, ...@@ -2424,7 +2424,7 @@ check_explicit_specialization (tree declarator,
switch (tsk) switch (tsk)
{ {
case tsk_none: case tsk_none:
if (processing_specialization) if (processing_specialization && TREE_CODE (decl) != VAR_DECL)
{ {
specialization = 1; specialization = 1;
SET_DECL_TEMPLATE_SPECIALIZATION (decl); SET_DECL_TEMPLATE_SPECIALIZATION (decl);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment