Commit cc656415 by Jason Merrill Committed by Jason Merrill

* class.c (declared_access): Split out from handle_using_decl.

From-SVN: r241739
parent 3ec82f68
2016-11-01 Jason Merrill <jason@redhat.com>
* class.c (declared_access): Split out from handle_using_decl.
2016-10-31 Jakub Jelinek <jakub@redhat.com> 2016-10-31 Jakub Jelinek <jakub@redhat.com>
PR c++/78089 PR c++/78089
......
...@@ -1299,6 +1299,16 @@ alter_access (tree t, tree fdecl, tree access) ...@@ -1299,6 +1299,16 @@ alter_access (tree t, tree fdecl, tree access)
return 0; return 0;
} }
/* Return the access node for DECL's access in its enclosing class. */
tree
declared_access (tree decl)
{
return (TREE_PRIVATE (decl) ? access_private_node
: TREE_PROTECTED (decl) ? access_protected_node
: access_public_node);
}
/* Process the USING_DECL, which is a member of T. */ /* Process the USING_DECL, which is a member of T. */
static void static void
...@@ -1306,10 +1316,7 @@ handle_using_decl (tree using_decl, tree t) ...@@ -1306,10 +1316,7 @@ handle_using_decl (tree using_decl, tree t)
{ {
tree decl = USING_DECL_DECLS (using_decl); tree decl = USING_DECL_DECLS (using_decl);
tree name = DECL_NAME (using_decl); tree name = DECL_NAME (using_decl);
tree access tree access = declared_access (using_decl);
= TREE_PRIVATE (using_decl) ? access_private_node
: TREE_PROTECTED (using_decl) ? access_protected_node
: access_public_node;
tree flist = NULL_TREE; tree flist = NULL_TREE;
tree old_value; tree old_value;
......
...@@ -5635,6 +5635,7 @@ extern tree get_vtable_decl (tree, int); ...@@ -5635,6 +5635,7 @@ extern tree get_vtable_decl (tree, int);
extern void resort_type_method_vec (void *, void *, extern void resort_type_method_vec (void *, void *,
gt_pointer_operator, void *); gt_pointer_operator, void *);
extern bool add_method (tree, tree, tree); extern bool add_method (tree, tree, tree);
extern tree declared_access (tree);
extern tree currently_open_class (tree); extern tree currently_open_class (tree);
extern tree currently_open_derived_class (tree); extern tree currently_open_derived_class (tree);
extern tree outermost_open_class (void); extern tree outermost_open_class (void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment