This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/8591: g++ crashes while instantiating templates
- From: bangerth at dealii dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, struppi at acm dot org
- Date: 15 Nov 2002 16:52:06 -0000
- Subject: Re: c++/8591: g++ crashes while instantiating templates
- Reply-to: bangerth at dealii dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, struppi at acm dot org, gcc-gnats at gcc dot gnu dot org
Synopsis: g++ crashes while instantiating templates
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Fri Nov 15 08:52:05 2002
State-Changed-Why:
Confirmed. A reduced testcase is
-------------------------------------
namespace NS {
template <class T1, class T2, class T3 = int, class T4 = int>
struct C {};
}
template <class T> class X {
friend class NS::C;
};
X<int> c;
----------------------------------
I get a segfault:
tmp/g> /home/bangerth/bin/gcc-3.3x-pre/bin/g++ -c x.cc
x.cc: In instantiation of `X<int>':
x.cc:10: instantiated from here
x.cc:6: internal compiler error: Speicherzugriffsfehler
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
This is for all versions of gcc, including present CVS.
My list of similar reports (friends and templates and/or
namespaces) includes PRs 8355, 8280, 8099, 53, 641, 765,
1016, 6256. The last one may be the closest.
By the way, the code is illegal, since you have to declare
the friend as
template <...> friend class NS::C;
Fixing this makes the ICE go away.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8591