diff options
author | ppalka <ppalka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-03-07 17:09:53 +0000 |
---|---|---|
committer | ppalka <ppalka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-03-07 17:09:53 +0000 |
commit | 981d18699e614ea8dc3ea71cd9b6859ac17732e8 (patch) | |
tree | 8b9f170bde7a5701eb23ee56701dcf2ed9a57018 | |
parent | 4dfabd94845d628d135601feca4ff4bfe11c1178 (diff) |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234038 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/pt.c | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a803ec98486..f58e34ecd20 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +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> PR c++/67364 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index f6dd75a89aa..515537b384b 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -330,7 +330,8 @@ get_template_info (const_tree t) if (!t || t == error_mark_node) return NULL; - if (TREE_CODE (t) == NAMESPACE_DECL) + if (TREE_CODE (t) == NAMESPACE_DECL + || TREE_CODE (t) == PARM_DECL) return NULL; if (DECL_P (t) && DECL_LANG_SPECIFIC (t)) @@ -378,7 +379,7 @@ template_class_depth (tree type) && uses_template_parms (INNERMOST_TEMPLATE_ARGS (TI_ARGS (tinfo)))) ++depth; - if (VAR_OR_FUNCTION_DECL_P (type)) + if (DECL_P (type)) type = CP_DECL_CONTEXT (type); else if (LAMBDA_TYPE_P (type)) type = LAMBDA_TYPE_EXTRA_SCOPE (type); |