public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17891] New: An expression accepted as lvalue by compiler but not assigned at run time
@ 2004-10-08 11:01 k dot karamazen at trinite dot nl
2004-10-08 11:14 ` [Bug c++/17891] " nathan at gcc dot gnu dot org
2004-10-15 17:16 ` pinskia at gcc dot gnu dot org
0 siblings, 2 replies; 3+ messages in thread
From: k dot karamazen at trinite dot nl @ 2004-10-08 11:01 UTC (permalink / raw)
To: gcc-bugs
// g++ -g -Wall nB2.cpp
// ./a.aut
#include<stdio.h>
static void f1(void* &x)
{
x=(void*)1;
}
int main(int , const char **)
{
int* a=(int*)2;
f1((void*)a);
printf("\n%p\n",a);//expected 0x1, got 0x2, no compiler error
return 1;
}
//g++ --version
//g++ (GCC) 3.3.3 20040412 (Red Hat Linux 3.3.3-7)
--
Summary: An expression accepted as lvalue by compiler but not
assigned at run time
Product: gcc
Version: 3.3.3
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: k dot karamazen at trinite dot nl
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17891
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/17891] An expression accepted as lvalue by compiler but not assigned at run time
2004-10-08 11:01 [Bug c++/17891] New: An expression accepted as lvalue by compiler but not assigned at run time k dot karamazen at trinite dot nl
@ 2004-10-08 11:14 ` nathan at gcc dot gnu dot org
2004-10-15 17:16 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: nathan at gcc dot gnu dot org @ 2004-10-08 11:14 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From nathan at gcc dot gnu dot org 2004-10-08 11:13 -------
The code is ill-formed, and requires a diagnostic.
Gcc3.4 and later give the following errors
17891.ii:8: error: invalid initialization of non-const reference of type
'void*&' from a temporary of type 'void*'
17891.ii:1: error: in passing argument 1 of `void f1(void*&)'
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17891
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/17891] An expression accepted as lvalue by compiler but not assigned at run time
2004-10-08 11:01 [Bug c++/17891] New: An expression accepted as lvalue by compiler but not assigned at run time k dot karamazen at trinite dot nl
2004-10-08 11:14 ` [Bug c++/17891] " nathan at gcc dot gnu dot org
@ 2004-10-15 17:16 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-15 17:16 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|critical |normal
Target Milestone|--- |3.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17891
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-10-15 17:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-08 11:01 [Bug c++/17891] New: An expression accepted as lvalue by compiler but not assigned at run time k dot karamazen at trinite dot nl
2004-10-08 11:14 ` [Bug c++/17891] " nathan at gcc dot gnu dot org
2004-10-15 17:16 ` pinskia at gcc dot gnu dot org
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).