This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/10468: Type interpreted as int& instead of const int&
- From: mgoodman at csua dot berkeley dot edu
- To: gcc-gnats at gcc dot gnu dot org
- Date: 23 Apr 2003 20:26:57 -0000
- Subject: c++/10468: Type interpreted as int& instead of const int&
- Reply-to: mgoodman at csua dot berkeley dot edu
>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 at csua dot berkeley dot 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