c++/7188: Segfault with template class and recursive (incorrect) initalizer list.
nathan@stitt.org
nathan@stitt.org
Tue Jul 2 20:36:00 GMT 2002
>Number: 7188
>Category: c++
>Synopsis: Segfault with template class and recursive (incorrect) initalizer list.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Jul 02 20:36:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: nathan@stitt.org
>Release: 3.1
>Organization:
>Environment:
Debian w both self compiled g++ v 3.1 and from unstable, vers. 3.1.1 20020606 (Debian prerelease)
>Description:
If a templated class is created, the initializer list is appently not checked for recursive initialization ( my guess anyway ). Code attached should never compile, and indead doesn't under g++ 2.95 and 3.0, however 3.1 segfaults while attempting compile. If template declaration from top of class is removed, segfault does not occur and appropriate error message is issued.
This is not a big deal to myself, as code is clearly very wrong. However since I was silly enough to accidently write it, I imagine that it's possible someone else will do the same at some point.
>How-To-Repeat:
attempt compile of attached code under g++ 3.1
>Fix:
Don't create brain dead code such as this :)
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="crash.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="crash.cc"
dGVtcGxhdGUgPGNsYXNzIFQgPgpjbGFzcyBmb28gCnsKcHVibGljOgoJZm9vKCkgOiBmb28oKQoJ
ewoKCX0KfTsKCmludAptYWluKGludCBhcmdjLCBjaGFyICoqYXJndil7Cglmb288aW50PiBiOwoJ
cmV0dXJuIDE7Cn0K
More information about the Gcc-prs
mailing list