diff options
author | lerdsuwa <lerdsuwa@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-07-17 13:56:46 +0000 |
---|---|---|
committer | lerdsuwa <lerdsuwa@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-07-17 13:56:46 +0000 |
commit | 01d4830b6cbb674c54a552c5bda2ec76285bb371 (patch) | |
tree | 079b81168d676a251b18616322bbb387b3e67174 /gcc/cp/decl.c | |
parent | 46cb2a9a6e5b694fdf46b081e65f39a711e36f41 (diff) | |
download | gcc-01d4830b6cbb674c54a552c5bda2ec76285bb371.tar.gz |
PR c++/4802, c++/5387
* decl.c (make_typename_type): Use enforce_access.
* g++.dg/template/access2.C: New test.
* g++.dg/template/access3.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55517 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 11d8fe58b80..c6d77d3321d 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -5652,6 +5652,9 @@ make_typename_type (context, name, complain) return error_mark_node; } + if (!enforce_access (context, tmpl)) + return error_mark_node; + return lookup_template_class (tmpl, TREE_OPERAND (fullname, 1), NULL_TREE, context, @@ -5672,6 +5675,9 @@ make_typename_type (context, name, complain) t = lookup_field (context, name, 0, 1); if (t) { + if (!enforce_access (context, t)) + return error_mark_node; + if (DECL_ARTIFICIAL (t) || !(complain & tf_keep_type_decl)) t = TREE_TYPE (t); if (IMPLICIT_TYPENAME_P (t)) |