public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/8488: invalid reference cast being accepted with -pedantic on
@ 2002-11-06 22:06 mrnobo1024
0 siblings, 0 replies; 3+ messages in thread
From: mrnobo1024 @ 2002-11-06 22:06 UTC (permalink / raw)
To: gcc-gnats
>Number: 8488
>Category: c++
>Synopsis: invalid reference cast being accepted with -pedantic on
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: accepts-illegal
>Submitter-Id: net
>Arrival-Date: Wed Nov 06 22:06:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: mrnobo1024@yahoo.com
>Release: unknown-1.0
>Organization:
>Environment:
Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --
target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=f77,c++,o
bjc,ada --disable-win32-registry --disable-shared
Thread model: win32
gcc version 3.2 (mingw special 20020817-1)
>Description:
"(int &)3 = 2;" gives the fatal error "conversion to non-const reference type `int&' from rvalue of type `int'" normally, but with -pedantic, it becomes a warning and compilation continues.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c++/8488: invalid reference cast being accepted with -pedantic on
@ 2002-11-07 9:26 Wolfgang Bangerth
0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Bangerth @ 2002-11-07 9:26 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/8488; it has been noted by GNATS.
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: gcc-gnats@gcc.gnu.org
Cc:
Subject: Re: c++/8488: invalid reference cast being accepted with -pedantic
on
Date: Thu, 7 Nov 2002 11:27:47 -0600 (CST)
This bug is probably related to 7307.
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ticam.utexas.edu
www: http://www.ticam.utexas.edu/~bangerth
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c++/8488: invalid reference cast being accepted with -pedantic on
@ 2002-11-07 7:13 bangerth
0 siblings, 0 replies; 3+ messages in thread
From: bangerth @ 2002-11-07 7:13 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, mrnobo1024, nobody
Synopsis: invalid reference cast being accepted with -pedantic on
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Thu Nov 7 07:13:28 2002
State-Changed-Why:
Very interesting. Indeed, this
(int &)3 = 2;
compiles into this:
movl $3,-4(%ebp)
leal -4(%ebp),%edx
movl $2,(%edx)
(Sure, after all, the code said: "take the address of the
3, and write a 2 into that place").
As an aside, from hearsay, some Fortran compilers allowed
you to do this:
subroutine f(i)
i = 2
end
subroutine g
call f(1)
write (*) 1
end
If you were unlucky, and the compiler chose to use the same
address for the two ones in g(), then you'd get a "2" onto
your screen, though you wrote "write (*) 1".
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8488
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-11-07 17:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-06 22:06 c++/8488: invalid reference cast being accepted with -pedantic on mrnobo1024
2002-11-07 7:13 bangerth
2002-11-07 9:26 Wolfgang Bangerth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).