🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #2208

initialization of reference error

#2208
From: Michael Tiemann
Date: Thu, 22 Feb 1990 13:22
46 lines
1457 bytes
   From: Glenn Engel <glenne@hplsla.hp.com>
   Elmto: bug-g++@prep.ai.mit.edu (g++ bugs)
   Date: Tue, 20 Feb 90 11:20:31 PST
   X-Mailer: Elm [version 1.7]

   compiler:  g++1.36.3 for hp9k320g.
   source:

   int *j;
   short * &p = (short *) j;
   int * &q = j;

   The initialization of q is fine, however the initialization of p is done
   by reading the contents of j.  I expected both p and q to point to j.


   #NO_APP
   gcc_compiled.:
   .globl _p
   .data
	   .even
   _p:
	   .long __$tmp_0
   .globl _q
	   .even
   _q:
	   .long _j
   .text
	   .even
   .globl __GLOBAL_$I$p
   __GLOBAL_$I$p:
	   link a6,#0
	   movel _j,__$tmp_0
   L1:
	   unlk a6
	   rts
   .stabs "___CTOR_LIST__",22,0,0,__GLOBAL_$I$p
   .lcomm __$tmp_0,4
   .comm _j,4

Casts are not lvalues.  cfront says "sorry, not implemented:
initializer for static reference not an lvaue".  Maybe GNU C++ should
give a similar warning.

Michael
Technical Details
Message-ID: <9002221322.AA00253@arkesden.sun.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!arkesden.eng.sun.com!tiemann
References: <9002201920.AA18056@labgre.HP.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!arkesden.eng.sun.com!tiemann
From: tiemann@arkesden.eng.sun.com (Michael Tiemann)
Newsgroups: gnu.g++.bug
Subject: initialization of reference error
Message-ID: <9002221322.AA00253@arkesden.sun.com>
Date: 22 Feb 90 13:22:24 GMT
References: <9002201920.AA18056@labgre.HP.COM>
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: tiemann@sun.com
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 46