Article View: gnu.g++.bug
Article #479[rjc@CS.UCLA.EDU: static const change (bug??)]
From: Michael Tiemann
Date: Mon, 09 Oct 1989 10:14
Date: Mon, 09 Oct 1989 10:14
41 lines
1633 bytes
1633 bytes
Michael,
I have brought up the new beta release of g++ (Oct 2 version).
I am having trouble with some of my (and other peoples) code that uses
`static const foo = 5' constructs in .h files. In previous versions,
this worked fine. Now, I get `Undefined symbol _foo ...' at ld-time.
Is this a bug in the latest version of g++, or a correct implementation?
Thanks,
rob collins
rjc@cs.ucla.edu
It was a screw-up. Here is a fix:
arkesden% diff -c2 cplus-typeck.c~ cplus-typeck.c
*** cplus-typeck.c~ Sun Oct 1 23:33:05 1989
--- cplus-typeck.c Mon Oct 9 02:20:12 1989
***************
*** 5132,5136 ****
if (type == TREE_TYPE (rhs) && TREE_CODE (type) != UNKNOWN_TYPE)
! return rhs;
return convert_for_assignment (type, rhs, errtype);
--- 5132,5140 ----
if (type == TREE_TYPE (rhs) && TREE_CODE (type) != UNKNOWN_TYPE)
! {
! if (TREE_READONLY (rhs) && TREE_CODE (rhs) == VAR_DECL)
! rhs = decl_constant_value (rhs);
! return rhs;
! }
return convert_for_assignment (type, rhs, errtype);
arkesden%
Michael
Technical Details
Message-ID:
<8910091014.AA20858@arkesden.sun.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ARKESDEN.ENG.SUN.COM!tiemannReferences:
<8910090522.AA29768@lurch.Stanford.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ARKESDEN.ENG.SUN.COM!tiemann From: tiemann@ARKESDEN.ENG.SUN.COM (Michael Tiemann) Newsgroups: gnu.g++.bug Subject: [rjc@CS.UCLA.EDU: static const change (bug??)] Message-ID: <8910091014.AA20858@arkesden.sun.com> Date: 9 Oct 89 10:14:49 GMT References: <8910090522.AA29768@lurch.Stanford.EDU> Sender: daemon@tut.cis.ohio-state.edu Reply-To: tiemann@sun.com Distribution: gnu Organization: GNUs Not Usenet Lines: 41