This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13611] Internal compiler error
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jan 2004 16:02:28 -0000
- Subject: [Bug c++/13611] Internal compiler error
- References: <20040108141330.13611.jpbarrette@savoirfairelinux.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-01-08 16:02 -------
The code is actually illegal: you need to write
template <> class OptionContainerType<std::string> {...}
for the explicit specialization. That doesn't make much
difference here, though, as this snippet still ICEs the compiler:
--------------------
template<typename T> struct O;
template <> struct O<int> {
typedef int I;
};
template<typename T, int i> struct A {
typedef typename O<T>::I P;
void foo(P);
};
template <int i>
void A<int, i>::foo(P) {};
---------------------------
g/x> /home/bangerth/bin/gcc-3.3.3-pre/bin/c++ -c x.cc
x.cc:13: internal compiler error: in tsubst, at cp/pt.c:6740
Please submit a full bug report,
This behavior is the same as with all compilers since 2.95, so it
is not a regression. With mainline, we get this:
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
x.cc:13: error: invalid use of undefined type `struct A<int, i>'
x.cc:7: error: declaration of `struct A<int, i>'
x.cc:13: error: `P' was not declared in this scope
x.cc:13: error: expected `;'
I believe this is correct, as the partial specialization has not been
declared and one can't only partially specialize a member function of
a template. In other words, the ICE has been fixed, and we have
a progression.
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |3.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13611