summaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-24 15:40:06 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-24 15:40:06 +0000
commite4f430b5f97fabfc71b51faa4d28914bf1292edb (patch)
treed50a764e01dcd1dc880e14a21c3e985f121b8667 /gcc/cp/pt.c
parentcafefe79cb417067ae3cb21995053657c435eec2 (diff)
downloadgcc-e4f430b5f97fabfc71b51faa4d28914bf1292edb.tar.gz
* call.c (enforce_access): Assert we get a binfo.
(build_op_delete_call): Pass a binfo to perform_or_defer_access_check. * class.c (alter_access): Likewise. * decl.c (make_typename_type): Likewise. (make_unbound_class_template): Likewise. * lex.c (do_identifier): Likewise. * method.c (hack_identifier): Likewise. * parser.c (cp_parser_lookup_name): Likewise. * search.c (lookup_member): Likewise. Move IDENTIFIER_CLASS_VALUE test. * semantics.c (finish_non_static_data_member): Likewise. (perform_or_defer_access_check): Expect a binfo. * typeck.c (comptypes): Expect types. * mangle.c (find_substitution): Don't pass a non-type to same_type_p * friend.c (make_friend_class): Likewise. * pt.c (check_default_tmpl_args): Likewise. (lookup_template_class): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68424 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 7ce9031e033..e29d434c000 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -2528,14 +2528,15 @@ check_default_tmpl_args (tree decl, tree parms, int is_primary, int is_partial)
&& DECL_LANG_SPECIFIC (decl)
/* If this is either a friend defined in the scope of the class
or a member function. */
- && ((DECL_CONTEXT (decl)
- && same_type_p (DECL_CONTEXT (decl), current_class_type))
- || (DECL_FRIEND_CONTEXT (decl)
- && same_type_p (DECL_FRIEND_CONTEXT (decl),
- current_class_type)))
+ && (DECL_FUNCTION_MEMBER_P (decl)
+ ? same_type_p (DECL_CONTEXT (decl), current_class_type)
+ : DECL_FRIEND_CONTEXT (decl)
+ ? same_type_p (DECL_FRIEND_CONTEXT (decl), current_class_type)
+ : false)
/* And, if it was a member function, it really was defined in
the scope of the class. */
- && (!DECL_FUNCTION_MEMBER_P (decl) || DECL_INITIALIZED_IN_CLASS_P (decl)))
+ && (!DECL_FUNCTION_MEMBER_P (decl)
+ || DECL_INITIALIZED_IN_CLASS_P (decl)))
/* We already checked these parameters when the template was
declared, so there's no need to do it again now. This function
was defined in class scope, but we're processing it's body now
@@ -4234,21 +4235,20 @@ lookup_template_class (tree d1,
{
tree ctx;
- /* Note that we use DECL_CONTEXT, rather than
- CP_DECL_CONTEXT, so that the termination test is
- always just `ctx'. We're not interested in namespace
- scopes. */
for (ctx = current_class_type;
ctx;
- ctx = (TYPE_P (ctx)) ? TYPE_CONTEXT (ctx) : DECL_CONTEXT (ctx))
- if (same_type_p (ctx, template_type))
- break;
+ ctx = TYPE_CONTEXT (ctx))
+ {
+ if (TREE_CODE (ctx) == NAMESPACE_DECL)
+ break;
+ if (same_type_p (ctx, template_type))
+ goto found_ctx;
+ }
- if (!ctx)
- /* We're not in the scope of the class, so the
- TEMPLATE_TYPE is not the type we want after
- all. */
- found = NULL_TREE;
+ /* We're not in the scope of the class, so the
+ TEMPLATE_TYPE is not the type we want after all. */
+ found = NULL_TREE;
+ found_ctx:;
}
}
if (found)