aboutsummaryrefslogtreecommitdiff
path: root/contrib/gcc/cp/pt.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc/cp/pt.c')
-rw-r--r--contrib/gcc/cp/pt.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/contrib/gcc/cp/pt.c b/contrib/gcc/cp/pt.c
index 477265d49d0d..ac28afa4136f 100644
--- a/contrib/gcc/cp/pt.c
+++ b/contrib/gcc/cp/pt.c
@@ -1971,7 +1971,7 @@ check_explicit_specialization (tree declarator,
context. */
fns = lookup_qualified_name (CP_DECL_CONTEXT (decl), dname,
false, true);
- if (!fns || !is_overloaded_fn (fns))
+ if (fns == error_mark_node || !is_overloaded_fn (fns))
{
error ("%qD is not a template function", dname);
fns = error_mark_node;
@@ -5288,6 +5288,15 @@ reopen_tinst_level (tree level)
pop_tinst_level ();
}
+/* Returns the TINST_LEVEL which gives the original instantiation
+ context. */
+
+tree
+outermost_tinst_level (void)
+{
+ return tree_last (current_tinst_level);
+}
+
/* DECL is a friend FUNCTION_DECL or TEMPLATE_DECL. ARGS is the
vector of template arguments, as for tsubst.
@@ -10453,6 +10462,8 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict)
case TEMPLATE_TEMPLATE_PARM:
case BOUND_TEMPLATE_TEMPLATE_PARM:
tparm = TREE_VALUE (TREE_VEC_ELT (tparms, 0));
+ if (tparm == error_mark_node)
+ return 1;
if (TEMPLATE_TYPE_LEVEL (parm)
!= template_decl_level (tparm))