aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/cp/mangle.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/cp/mangle.c')
-rw-r--r--gcc-4.9/gcc/cp/mangle.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc-4.9/gcc/cp/mangle.c b/gcc-4.9/gcc/cp/mangle.c
index 169f84451..0ed28087c 100644
--- a/gcc-4.9/gcc/cp/mangle.c
+++ b/gcc-4.9/gcc/cp/mangle.c
@@ -763,8 +763,7 @@ decl_mangling_context (tree decl)
if (extra)
return extra;
}
- else if (TREE_CODE (decl) == TYPE_DECL
- && TREE_CODE (TREE_TYPE (decl)) == TEMPLATE_TYPE_PARM)
+ else if (template_type_parameter_p (decl))
/* template type parms have no mangling context. */
return NULL_TREE;
return CP_DECL_CONTEXT (decl);
@@ -3112,6 +3111,8 @@ write_template_arg (tree node)
}
}
+ if (REFERENCE_REF_P (node))
+ node = TREE_OPERAND (node, 0);
if (TREE_CODE (node) == NOP_EXPR
&& TREE_CODE (TREE_TYPE (node)) == REFERENCE_TYPE)
{