c++/995: internal compiler error 18

caldwell@aggies.org caldwell@aggies.org
Tue Dec 5 19:46:00 GMT 2000


>Number:         995
>Category:       c++
>Synopsis:       internal compiler error 18
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 05 19:46:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     David Caldwell
>Release:        2.95.2 19991024
>Organization:
>Environment:
djgpp on windows 98
>Description:
The attached file when compiled as follows yields the following error:

gxx -Wall -g -o pkupstix.exe pkupstix.cc
<internal>:0: Internal compiler error 18.
<internal>:0: Please submit a full bug report.
<internal>:0: See <URL: http://www.gnu.org/software/gcc/faq.html#bugreport > for instructions.
>How-To-Repeat:
compile it
>Fix:
?
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="pkupstix.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="pkupstix.cc"

CiNpbmNsdWRlIDxpb3N0cmVhbS5oPgojaW5jbHVkZSA8c3Ryc3RyZWFtLmg+CiNpbmNsdWRlIDxm
c3RyZWFtLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHZlY3Rvci5oPgojaW5jbHVk
ZSA8bWFwLmg+CiNpbmNsdWRlIDxsaXN0Lmg+CiNpbmNsdWRlICJxdWV1ZWxsLmgiCiNpbmNsdWRl
ICJwcmlvcnEuaCIKCgoKLy8gYmFzaWMgaXRlbSBzdG9yZWQgaW4gYWRqYWNlbmN5IGxpc3QKCnRl
bXBsYXRlIDxjbGFzcyBEaXN0VHlwZT4Kc3RydWN0IEVkZ2UKewogIGludCBEZXN0OyAgICAgIC8v
IHRoZSBzZWNvbmQgbm9kZSBpbiB0aGUgZWRnZSAoZmlyc3QgaXMgaW1wbGljaXQpCiAgRGlzdFR5
cGUgQ29zdDsgLy8gZWRnZSBjb3N0CgogIEVkZ2UoKSB7fQogIEV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