c++/9865: traits for const types have bad results

dbeck@beckground.hu dbeck@beckground.hu
Wed Feb 26 16:36:00 GMT 2003


>Number:         9865
>Category:       c++
>Synopsis:       traits for const types have bad results
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 26 16:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     David Beck
>Release:        gcc version 3.2.2
>Organization:
>Environment:
FreeBSD 4.7 Intel
>Description:
The output of the attached file is pretty self explanatory.
>How-To-Repeat:
Compile the test program. Run it. Test output for errors.
>Fix:
No idea.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="test.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.cc"

CiNpbmNsdWRlIDxjYXNzZXJ0PgojaW5jbHVkZSA8c3RkaW8uaD4KCm5hbWVzcGFjZSB0eXBlX21h
bmlwCnsKCXRlbXBsYXRlIDx0eXBlbmFtZSBUPiBzdHJ1Y3QgaXNfY29uc3QgeyBlbnVtIHsgdGNh
c2U9MCB9OyB9OwoJdGVtcGxhdGUgPHR5cGVuYW1lIFQ+IHN0cnVjdCBpc19jb25zdDxUIGNvbnN0
PiB7IGVudW0geyB0Y2FzZT0xIH07IH07Cgl0ZW1wbGF0ZSA8dHlwZW5hbWUgVD4gc3RydWN0IGlz
X2NvbnN0PFQgY29uc3QgJj4geyBlbnVtIHsgdGNhc2U9MiB9OyB9OwoJdGVtcGxhdGUgPHR5cGVu
YW1lIFQ+IHN0cnVjdCBpc19jb25zdDxUIGNvbnN0ICo+IHsgZW51bSB7IHRjYXNlPTMgfTsgfTsK
CXRlbXBsYXRlIDx0eXBlbmFtZSBUPiBzdHJ1Y3QgaXNfY29uc3Q8VCogY29uc3QgJj4geyBlbnVt
IHsgdGNhc2U9NCB9OyB9OwoJdGVtcGxhdGUgPHR5cGVuYW1lIFQ+IHN0cnVjd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