pt.c (171826) | pt.c (220150) |
---|---|
1/* Handle parameterized types (templates) for GNU C++. 2 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 3 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 4 Written by Ken Raeburn (raeburn@cygnus.com) while at Watchmaker Computing. 5 Rewritten by Jason Merrill (jason@cygnus.com). 6 7This file is part of GCC. 8 --- 1957 unchanged lines hidden (view full) --- 1966 /* If there is no class context, the explicit instantiation 1967 must be at namespace scope. */ 1968 gcc_assert (DECL_NAMESPACE_SCOPE_P (decl)); 1969 1970 /* Find the namespace binding, using the declaration 1971 context. */ 1972 fns = lookup_qualified_name (CP_DECL_CONTEXT (decl), dname, 1973 false, true); | 1/* Handle parameterized types (templates) for GNU C++. 2 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 3 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 4 Written by Ken Raeburn (raeburn@cygnus.com) while at Watchmaker Computing. 5 Rewritten by Jason Merrill (jason@cygnus.com). 6 7This file is part of GCC. 8 --- 1957 unchanged lines hidden (view full) --- 1966 /* If there is no class context, the explicit instantiation 1967 must be at namespace scope. */ 1968 gcc_assert (DECL_NAMESPACE_SCOPE_P (decl)); 1969 1970 /* Find the namespace binding, using the declaration 1971 context. */ 1972 fns = lookup_qualified_name (CP_DECL_CONTEXT (decl), dname, 1973 false, true); |
1974 if (!fns || !is_overloaded_fn (fns)) | 1974 if (fns == error_mark_node || !is_overloaded_fn (fns)) |
1975 { 1976 error ("%qD is not a template function", dname); 1977 fns = error_mark_node; 1978 } 1979 else 1980 { 1981 tree fn = OVL_CURRENT (fns); 1982 if (!is_associated_namespace (CP_DECL_CONTEXT (decl), --- 3300 unchanged lines hidden (view full) --- 5283 tinst_depth = 0; 5284 for (t = level; t; t = TREE_CHAIN (t)) 5285 ++tinst_depth; 5286 5287 current_tinst_level = level; 5288 pop_tinst_level (); 5289} 5290 | 1975 { 1976 error ("%qD is not a template function", dname); 1977 fns = error_mark_node; 1978 } 1979 else 1980 { 1981 tree fn = OVL_CURRENT (fns); 1982 if (!is_associated_namespace (CP_DECL_CONTEXT (decl), --- 3300 unchanged lines hidden (view full) --- 5283 tinst_depth = 0; 5284 for (t = level; t; t = TREE_CHAIN (t)) 5285 ++tinst_depth; 5286 5287 current_tinst_level = level; 5288 pop_tinst_level (); 5289} 5290 |
5291/* Returns the TINST_LEVEL which gives the original instantiation 5292 context. */ 5293 5294tree 5295outermost_tinst_level (void) 5296{ 5297 return tree_last (current_tinst_level); 5298} 5299 |
|
5291/* DECL is a friend FUNCTION_DECL or TEMPLATE_DECL. ARGS is the 5292 vector of template arguments, as for tsubst. 5293 5294 Returns an appropriate tsubst'd friend declaration. */ 5295 5296static tree 5297tsubst_friend_function (tree decl, tree args) 5298{ --- 5149 unchanged lines hidden (view full) --- 10448 argument values cannot be deduced for template parameters used 10449 within the nested-name-specifier. */ 10450 return 0; 10451 10452 case TEMPLATE_TYPE_PARM: 10453 case TEMPLATE_TEMPLATE_PARM: 10454 case BOUND_TEMPLATE_TEMPLATE_PARM: 10455 tparm = TREE_VALUE (TREE_VEC_ELT (tparms, 0)); | 5300/* DECL is a friend FUNCTION_DECL or TEMPLATE_DECL. ARGS is the 5301 vector of template arguments, as for tsubst. 5302 5303 Returns an appropriate tsubst'd friend declaration. */ 5304 5305static tree 5306tsubst_friend_function (tree decl, tree args) 5307{ --- 5149 unchanged lines hidden (view full) --- 10457 argument values cannot be deduced for template parameters used 10458 within the nested-name-specifier. */ 10459 return 0; 10460 10461 case TEMPLATE_TYPE_PARM: 10462 case TEMPLATE_TEMPLATE_PARM: 10463 case BOUND_TEMPLATE_TEMPLATE_PARM: 10464 tparm = TREE_VALUE (TREE_VEC_ELT (tparms, 0)); |
10465 if (tparm == error_mark_node) 10466 return 1; |
|
10456 10457 if (TEMPLATE_TYPE_LEVEL (parm) 10458 != template_decl_level (tparm)) 10459 /* The PARM is not one we're trying to unify. Just check 10460 to see if it matches ARG. */ 10461 return (TREE_CODE (arg) == TREE_CODE (parm) 10462 && same_type_p (parm, arg)) ? 0 : 1; 10463 idx = TEMPLATE_TYPE_IDX (parm); --- 2912 unchanged lines hidden --- | 10467 10468 if (TEMPLATE_TYPE_LEVEL (parm) 10469 != template_decl_level (tparm)) 10470 /* The PARM is not one we're trying to unify. Just check 10471 to see if it matches ARG. */ 10472 return (TREE_CODE (arg) == TREE_CODE (parm) 10473 && same_type_p (parm, arg)) ? 0 : 1; 10474 idx = TEMPLATE_TYPE_IDX (parm); --- 2912 unchanged lines hidden --- |