The following valid code snippet triggers an ICE on the trunk: ============================== struct A { typedef int X; }; template<int> union B { A::X x; }; ============================== bug.cc:8:6: internal compiler error: in append_type_to_template_for_access_check_1, at cp/pt.c:17353 Please submit a full bug report, [etc.] The regression appeared between 2009-05-22 and 2009-06-01. Looks like it was caused by the following patch: 2009-05-26 Dodji Seketeli <dodji@redhat.com> 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. [...]
Patch submitted here: http://gcc.gnu.org/ml/gcc-patches/2009-07/msg00213.html
Subject: Bug 40557 Author: simartin Date: Mon Jul 6 04:55:20 2009 New Revision: 149276 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149276 Log: gcc/cp/ 2009-07-06 Simon Martin <simartin@users.sourceforge.net> PR c++/40557 * pt.c (perform_typedefs_access_check, get_types_needing_access_check, append_type_to_template_for_access_check_1): Use RECORD_OR_UNION_CODE_P. gcc/testsuite/ 2009-07-06 Simon Martin <simartin@users.sourceforge.net> PR c++/40557 * g++.dg/template/union2.C: New test. Added: trunk/gcc/testsuite/g++.dg/template/union2.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c trunk/gcc/testsuite/ChangeLog
Fixed in 4.5
Subject: Bug 40557 Author: hjl Date: Wed Jul 8 14:30:12 2009 New Revision: 149371 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149371 Log: 2009-07-08 H.J. Lu <hongjiu.lu@intel.com> Backport from mainline: 2009-07-06 Simon Martin <simartin@users.sourceforge.net> PR c++/40557 * g++.dg/template/union2.C: New test. Added: branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/union2.C - copied unchanged from r149370, trunk/gcc/testsuite/g++.dg/template/union2.C Modified: branches/gcc-4_4-branch/gcc/testsuite/ChangeLog