pt.c
528 KB
-
re PR c++/40007 (specialization causes access problem in primary template) · 2eb25c98
Fix PR c++/40007 gcc/cp/ChangeLog: PR c++/40007 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Remove this accessor. (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): New accessor. (get_types_needing_access_check): Declare new entry point. * pt.c (append_type_to_template_for_access_check_1, get_types_needing_access_check): New functions. (perform_typedefs_access_check): Accept FUNCTION_DECLs and RECORD_TYPEs rather than TEMPLATE_DECLs. Use the new get_types_needing_access_check, no more MEMBER_TYPES_NEEDING_ACCESS_CHECK. (instantiate_class_template): Set input_location to the source location of the most specialized template definition. Perform access check using the RECORD_TYPE of the template, not its associated most generic TEMPLATE_DECL. (append_type_to_template_for_access_check): Augment function comments. Use the new get_types_needing_access_check, not MEMBER_TYPE_NEEDING_ACCESS_CHECK. Use the new append_type_to_template_for_access_check_1 subroutine. gcc/testsuite/ChangeLog: PR c++/40007 * g++.dg/template/typedef18.C: New test. * g++.dg/template/typedef19.C: Likewise. * g++.dg/template/typedef20.C: Likewise. * g++.dg/template/access11.C: Adjust. From-SVN: r147866
Dodji Seketeli committed