summaryrefslogtreecommitdiffstats
path: root/gcc/cp/search.c
diff options
context:
space:
mode:
authorlerdsuwa <lerdsuwa@138bc75d-0d04-0410-961f-82ee72b054a4>2002-07-22 14:23:37 +0000
committerlerdsuwa <lerdsuwa@138bc75d-0d04-0410-961f-82ee72b054a4>2002-07-22 14:23:37 +0000
commitd91f677533374080a77615e1628d15a0316d495b (patch)
tree03d4d4ae02f393f6f7171d9364e1ec68a2ced3fd /gcc/cp/search.c
parent07b68c99b9f6c2d3ff0396a97df40cf4aaf4ec3e (diff)
downloadppe42-gcc-d91f677533374080a77615e1628d15a0316d495b.tar.gz
ppe42-gcc-d91f677533374080a77615e1628d15a0316d495b.zip
PR c++/7347, c++/7348
* cp-tree.h (tsubst_flags_t): Add tf_parsing. * decl.c (make_typename_type): Use it. (make_unbound_class_template): Likewise. (lookup_name_real): Don't call type_access_control if scope is template parameter dependent. * parse.y (template_arg): Call make_unbound_class_template with tf_parsing set. (nest_name_specifier): Call make_typename_type with tf_parsing set. (typename_sub0): Likewise. (typename_sub1): Likewise. (instantiate_decl): Push class scope. * pt.c (regenerate_decl_from_template): Call pushclass and popclass for both static variable and member function template. (instantiate_decl) Call pushclass and popclass when tsubst'ing type and arguments. * search.c (type_access_control): Do type access for TEMPLATE_DECL too. * g++.dg/template/access4.C: New test. * g++.dg/template/access5.C: New test. * g++.old-deja/g++.pt/memtemp85.C: Fix access problem. * g++.old-deja/g++.pt/memtemp86.C: Likewise. * g++.old-deja/g++.pt/ttp58.C: Likewise. * g++.old-deja/g++.pt/memtemp89.C: Remove XFAIL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55649 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/search.c')
-rw-r--r--gcc/cp/search.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index b7ba0bc4dae..95d5dde8cf0 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -971,8 +971,8 @@ friend_accessible_p (scope, decl, binfo)
return 0;
}
-/* Perform access control on TYPE_DECL VAL, which was looked up in TYPE.
- This is fairly complex, so here's the design:
+/* Perform access control on TYPE_DECL or TEMPLATE_DECL VAL, which was
+ looked up in TYPE. This is fairly complex, so here's the design:
The lang_extdef nonterminal sets type_lookups to NULL_TREE before we
start to process a top-level declaration.
@@ -995,7 +995,8 @@ void
type_access_control (type, val)
tree type, val;
{
- if (val == NULL_TREE || TREE_CODE (val) != TYPE_DECL
+ if (val == NULL_TREE
+ || (TREE_CODE (val) != TEMPLATE_DECL && TREE_CODE (val) != TYPE_DECL)
|| ! DECL_CLASS_SCOPE_P (val))
return;
OpenPOWER on IntegriCloud