aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2020-06-16 08:21:36 -0400
committerPatrick Palka <ppalka@redhat.com>2020-06-16 08:21:36 -0400
commit668ef28fbb44c1e51d9c5a35b421903c98d87b03 (patch)
tree68056ecbe3d4103612be2d73a92a1442cfaa077c /gcc/cp/semantics.c
parent92bed036098928cd4659c8990e14cf7ad040e0c2 (diff)
downloadgcc-668ef28fbb44c1e51d9c5a35b421903c98d87b03.zip
gcc-668ef28fbb44c1e51d9c5a35b421903c98d87b03.tar.gz
gcc-668ef28fbb44c1e51d9c5a35b421903c98d87b03.tar.bz2
c++: Clean up previous change [PR41437]
The previous patch mostly avoided making any changes that had no functional impact, such as adjusting now-outdated comments and performing renamings. Such changes have been consolidated to this followup patch for easier review. The main change here is that we now reuse struct deferred_access_check as the element type of the vector TI_TYPEDEFS_NEEDING_ACCESS_CHECKING (now renamed to TI_DEFERRED_ACCESS_CHECKS, since it may contain any kind of access check). gcc/cp/ChangeLog: PR c++/41437 PR c++/47346 * cp-tree.h (qualified_typedef_usage_s): Delete. (qualified_typedef_usage_t): Delete. (deferred_access_check): Move up in file. (tree_template_info::typedefs_needing_access_checking): Delete. (tree_template_info::deferred_access_checks): New field. (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): Rename to ... (TI_DEFERRED_ACCESS_CHECKS): ... this, and adjust accordingly. * pt.c (perform_typedefs_access_check): Rename to ... (perform_instantiation_time_access_checks): ... this, and adjust accordingly. Remove unnecessary tree tests. (instantiate_class_template_1): Adjust accordingly. (instantiate_decl): Likewise. * semantics.c (enforce_access): Likewise.
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 13b844a..a04b0aa 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -295,12 +295,12 @@ enforce_access (tree basetype_path, tree decl, tree diag_decl,
return true;
/* Defer this access check until instantiation time. */
- qualified_typedef_usage_t typedef_usage;
- typedef_usage.typedef_decl = decl;
- typedef_usage.context = TREE_TYPE (basetype_path);
- typedef_usage.locus = input_location;
- vec_safe_push (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING (template_info),
- typedef_usage);
+ deferred_access_check access_check;
+ access_check.binfo = basetype_path;
+ access_check.decl = decl;
+ access_check.diag_decl = diag_decl;
+ access_check.loc = input_location;
+ vec_safe_push (TI_DEFERRED_ACCESS_CHECKS (template_info), access_check);
return true;
}