Commit dbb23418 by Patrick Palka

Adjust fix for PR c++/66786

gcc/cp/ChangeLog:

	PR c++/66786
	* pt.c (get_template_info): Handle PARM_DECL.
	(template_class_depth): Check DECL_P instead of
	VAR_OR_FUNCTION_DECL_P.

From-SVN: r234038
parent a84a49b7
2016-03-07 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/66786
* pt.c (get_template_info): Handle PARM_DECL.
(template_class_depth): Check DECL_P instead of
VAR_OR_FUNCTION_DECL_P.
2016-03-05 Jason Merrill <jason@redhat.com> 2016-03-05 Jason Merrill <jason@redhat.com>
PR c++/67364 PR c++/67364
......
...@@ -330,7 +330,8 @@ get_template_info (const_tree t) ...@@ -330,7 +330,8 @@ get_template_info (const_tree t)
if (!t || t == error_mark_node) if (!t || t == error_mark_node)
return NULL; return NULL;
if (TREE_CODE (t) == NAMESPACE_DECL) if (TREE_CODE (t) == NAMESPACE_DECL
|| TREE_CODE (t) == PARM_DECL)
return NULL; return NULL;
if (DECL_P (t) && DECL_LANG_SPECIFIC (t)) if (DECL_P (t) && DECL_LANG_SPECIFIC (t))
...@@ -378,7 +379,7 @@ template_class_depth (tree type) ...@@ -378,7 +379,7 @@ template_class_depth (tree type)
&& uses_template_parms (INNERMOST_TEMPLATE_ARGS (TI_ARGS (tinfo)))) && uses_template_parms (INNERMOST_TEMPLATE_ARGS (TI_ARGS (tinfo))))
++depth; ++depth;
if (VAR_OR_FUNCTION_DECL_P (type)) if (DECL_P (type))
type = CP_DECL_CONTEXT (type); type = CP_DECL_CONTEXT (type);
else if (LAMBDA_TYPE_P (type)) else if (LAMBDA_TYPE_P (type))
type = LAMBDA_TYPE_EXTRA_SCOPE (type); type = LAMBDA_TYPE_EXTRA_SCOPE (type);
......
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