Bug 10706 - ICE in mangle_class_name_for_template
Summary: ICE in mangle_class_name_for_template
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: 3.3.3
Assignee: Not yet assigned to anyone
URL:
Keywords: error-recovery, ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2003-05-09 16:06 UTC by Wolfgang Bangerth
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
new-ice-33-2.ii.bz2 (161.14 KB, application/octet-stream)
2003-05-21 15:17 UTC, Wolfgang Bangerth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Bangerth 2003-05-09 16:06:00 UTC
This is fallout from PR 10661:

The attached file fails, after some error messages like here
new-ice-33-2.ii:52879:   instantiated from `pm::Set<pm::Vector<int>, pm::BuildBinary<pm::operations::cmp> >'
new-ice-33-2.ii:52879:   instantiated from here
new-ice-33-2.ii:32392: error: template argument 1 is invalid
new-ice-33-2.ii:32392: internal compiler error: tree check: expected tree_vec,
   have error_mark in mangle_class_name_for_template, at cp/pt.c:3845

It's very hard to cut down the code, so I attach a big chunk
now and hope to have time to cut down on it later.

Note that I can't presently tell whether it also fails in
mainline, or whether it's a regression, since the code
doesn't compile with 3.4 at all.

W.

Release:
unknown
Comment 1 Volker Reichelt 2003-05-27 00:29:15 UTC
A reduced testcase is the following:

--------------------------------------------
template <typename> struct A
{
    template <typename> struct B {};
};

struct C
{
    typedef X Y;
    A<int>::B<Y> b;
};
--------------------------------------------

The error message from gcc 3.3 is:

PR10706.cc:8: error: ISO C++ forbids declaration of `X' with no type
PR10706.cc:8: error: parse error before `;' token
PR10706.cc:9: error: `Y' was not declared in this scope
PR10706.cc:9: error: template argument 1 is invalid
PR10706.cc:9: internal compiler error: tree check: expected tree_vec, have 
   error_mark in mangle_class_name_for_template, at cp/pt.c:3845
Please submit a full bug report, [etc.]

The code crashes every release since gcc 2.95.x.
Since it is not a regression and the problem is fixed on mainline,
I close the PR.
Comment 2 Volker Reichelt 2004-01-26 09:48:11 UTC
Now also fixed for 3.3.3 (most likely by Kriang's fix for PR 10555).