OSDN Git Service

Fix PR c++/40007
authordodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 May 2009 10:35:16 +0000 (10:35 +0000)
committerdodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 May 2009 10:35:16 +0000 (10:35 +0000)
commitd5f372e698a8617b13571ec39aeb86449697b78e
tree3d65d44a42717c7f7d4a2537e6e32c193c7d5fae
parent3266a7172151414bf6baed3cd8b54acb6365c477
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147866 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/access11.C
gcc/testsuite/g++.dg/template/typedef18.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/typedef19.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/typedef20.C [new file with mode: 0644]