c++/10468: Type interpreted as int& instead of const int&

mgoodman@csua.berkeley.edu mgoodman@csua.berkeley.edu
Wed Apr 23 20:36:00 GMT 2003


>Number:         10468
>Category:       c++
>Synopsis:       Type interpreted as int& instead of const int&
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 23 20:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     mgoodman@csua.berkeley.edu
>Release:        gcc version 3.4 20030423 (experimental)
>Organization:
>Environment:
Red Hat Linux 9
>Description:
gcc interprets the type of t1 as int& instead of const int& in the attached code.

The error shows up in the gcc-3_2-branch as well but the message is different.

The code compiles in gcc 2.95.3.
>How-To-Repeat:
gcc -c -o test test.ii
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="test.ii"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.ii"

IyAxICJ0ZXN0LmNjIgojIDEgIjxidWlsdC1pbj4iCiMgMSAiPGNvbW1hbmQgbGluZT4iCiMgMSAi
dGVzdC5jYyIKdGVtcGxhdGUgPGNsYXNzIFQ+CnZvaWQgdGVzdChUIHQpIHsKICBpbnQgeCA9IDA7
CiAgY29uc3QgdHlwZW9mKHgpICYgdDEgPSB4KzA7Cn0KCmludCBtYWluKGludCBhcmdjLCBjaGFy
ICoqYXJndikgewogIHRlc3QoMCk7CiAgcmV0dXJuIDA7Cn0K



More information about the Gcc-bugs mailing list