This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/40007] [4.5 regression] specialization causes access problem in primary template
- From: "dodji at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 May 2009 10:35:32 -0000
- Subject: [Bug c++/40007] [4.5 regression] specialization causes access problem in primary template
- References: <bug-40007-5876@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from dodji at gcc dot gnu dot org 2009-05-26 10:35 -------
Subject: Bug 40007
Author: dodji
Date: Tue May 26 10:35:16 2009
New Revision: 147866
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147866
Log:
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.
Added:
trunk/gcc/testsuite/g++.dg/template/typedef18.C
trunk/gcc/testsuite/g++.dg/template/typedef19.C
trunk/gcc/testsuite/g++.dg/template/typedef20.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/template/access11.C
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40007