public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/9311: g++ 3.2.1 - ICE on illegal code using templates and inheritance
@ 2003-01-14 16:46 Neil.Ferguson
  0 siblings, 0 replies; only message in thread
From: Neil.Ferguson @ 2003-01-14 16:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         9311
>Category:       c++
>Synopsis:       g++ 3.2.1 - ICE on illegal code using templates and inheritance
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 14 08:46:01 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Neil Ferguson
>Release:        gcc version 3.2.1
>Organization:
>Environment:
g++ -v:

Reading specs from /users/nf50041/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/specs
Configured with: ../gcc-3.2.1-original/configure --prefix=/users/nf50041 --with-gnu-as --with-gnu-ld --enable-languages=c,c++
Thread model: posix
gcc version 3.2.1

Also using binutils-2.13.1; uname -a gives: 

SunOS waverley 5.8 Generic_108528-13 sun4u sparc SUNW,Ultra-5_10

and the architecture is (Ultra) sparc32.
>Description:
The attached (very small) source file causes an ICE when 
compiled. It defines two class templates, A and B, then 
tries to define class C as an inner class of B, inheriting 
from A. However, the definition of B does not include a 
declaration of C. 

Deleting the inheritance from A allows the compiler to 
correctly output this error: 

failure.cxx:17: invalid definition of qualified type `B<T>::C'
failure.cxx:17: `struct B<T>::<anonymous>' does not declare a template type

Uncommenting the declaration of C in B produces legal 
code, which the compiler compiles without trouble. 
>How-To-Repeat:
Run: 

g++ -c failure.cxx

and you should get: 

failure.cxx:17: internal error: Segmentation Fault
>Fix:
None known (write legal code :-)
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="failure.cxx"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="failure.cxx"

Ly8gRmFpbHVyZSBjYXNlLiAKCnRlbXBsYXRlPHR5cGVuYW1lIFQ+CmNsYXNzIEEKewoKfTsKCnRl
bXBsYXRlPHR5cGVuYW1lIFQ+IApjbGFzcyBCIAp7CiAgICAvLyBjbGFzcyBDOwp9OyAKCnRlbXBs
YXRlPHR5cGVuYW1lIFQ+CmNsYXNzIEI8VD46OkMgOiBwdWJsaWMgQTxUPiAKewoKfTsgCg==


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

only message in thread, other threads:[~2003-01-14 16:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-14 16:46 c++/9311: g++ 3.2.1 - ICE on illegal code using templates and inheritance Neil.Ferguson

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).