re PR c++/40007 (specialization causes access problem in primary template)
authorDodji Seketeli <dodji@redhat.com>
Tue, 26 May 2009 10:35:16 +0000 (10:35 +0000)
committerDodji Seketeli <dodji@gcc.gnu.org>
Tue, 26 May 2009 10:35:16 +0000 (12:35 +0200)
commit2eb25c98ab88d63e27089a920f3fbd6fc485cd9e
tree3d65d44a42717c7f7d4a2537e6e32c193c7d5fae
parent52c3075d2b966a735dd2052437ddc00ce335aa85
re PR c++/40007 (specialization causes access problem in primary template)

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
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]