This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17891] New: An expression accepted as lvalue by compiler but not assigned at run time
- From: "k dot karamazen at trinite dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Oct 2004 11:01:09 -0000
- Subject: [Bug c++/17891] New: An expression accepted as lvalue by compiler but not assigned at run time
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
// 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