c++/1935: g++ gives internal compiler error on struct in member template in template class

robert@conceptlabs.net robert@conceptlabs.net
Sun Feb 11 13:26:00 GMT 2001


>Number:         1935
>Category:       c++
>Synopsis:       g++ gives internal compiler error on struct in member template in template class
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 11 13:26:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Robert Pierce
>Release:        2.95.2.1
>Organization:
>Environment:
i686-pc-linux-gnu, glibc 2.2.1, kernel 2.4.1
>Description:
Define a struct in a member template in a template class 
gives internal compiler error.  
>How-To-Repeat:
g++ template_struct_bug.ii
>Fix:
This is byzantine but correct code AFAIK.  One work around
is to use typedefs.  However, I run into it writing library 
classes employing STL and threads.  The pthread_cleanup_push
macro defines a struct _pthread_cleanup_buffer, which triggers 
the problem.  One can hack pthread.h, but this really seems
to be a compiler problem.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="template_struct_bug.ii"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="template_struct_bug.ii"

IyAxICJ0ZW1wbGF0ZV9zdHJ1Y3RfYnVnLkMiCgpzdHJ1Y3QgX2Zvb3N0cnVjdCB7IGludCBhOyB9
OwoKdGVtcGxhdGU8Y2xhc3MgQT4KY2xhc3MgRm9vIHsKcHVibGljOgogICBGb28oKSB7fQoKICAg
dGVtcGxhdGU8Y2xhc3MgQj4KICAgdm9pZCBiYXIoQiAmYikgeyAKICAgICAgIHN0cnVjdCBfZm9v
c3RydWN0IGZvbzsgICAKICAgICAgIGIgPSBmb28uYTsKICAgfQoKfTsKCmludCBtYWluKHZvaWQp
IHsKICAgRm9vPGludD4gZjsKICAgaW50IGEgPSAyOwogICBmLmJhcihhKTsKICAgcmV0dXJuIDA7
Cn0K



More information about the Gcc-bugs mailing list