>Submitter-Id:  net
>Originator:    Claudius Link
>Organization:  University Freiburg, Institute for Applied Mathematics
>Confidential:  no
>Synopsis:      Template specialisation causes internal error
>Severity:      serious
>Priority:      low
>Category:      c++
>Class:         ice-on-legal-code
>Release:       3.0.4 (Debian testing/unstable)
>Environment:
System: Linux zaphod 2.4.18 #1 SMP Tue Apr 16 19:32:36 CEST 2002 i686 unknown
Architecture: i686

        
host: i386-pc-linux-gnu
build: i386-pc-linux-gnu
target: i386-pc-linux-gnu
configured with: ../src/configure -v 
--enable-languages=c,c++,java,f77,proto,objc --prefix=/usr 
--infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as 
--with-gnu-ld --with-system-zlib --enable-long-long --enable-nls 
--without-included-gettext --disable-checking --enable-threads=posix 
--enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux
>Description:
First of all, I am not sure if the code is really leagal. But a least I get
an ICE for sure.

If you create a templcate class without specifying a (default) constructor but
you provide later a specialised (default) constructor. I get an ICE.

The same applies for 
        GNU C++ version 2.95.4 20011002 (Debian prerelease) (i386-linux)
        compiled by GNU C version 2.95.4 20011002 (Debian prerelease).

>How-To-Repeat:
# 1 "tempspec.cc"
template<class T>
struct Foo
{

};

Foo<int>::Foo()
{
}

void bar()
{
        Foo<int> f;
}
>Fix:
Pretty easy. Just add the "prototype" of the constructor in the
unspecialised template declaration.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


Reply via email to