public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/6446: ICE specialising template constructor
@ 2002-04-25  2:26 Claudius Link
  0 siblings, 0 replies; only message in thread
From: Claudius Link @ 2002-04-25  2:26 UTC (permalink / raw)
  To: gcc-gnats, debian-gcc


>Number:         6446
>Category:       c++
>Synopsis:       Template specialisation causes internal error
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 25 02:26:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Claudius Link
>Release:        3.0.4 (Debian testing/unstable)
>Organization:
University Freiburg, Institute for Applied Mathematics
>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.
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-04-25  9:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-25  2:26 c++/6446: ICE specialising template constructor Claudius Link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).